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

<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 () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", true);
                }
            });
        }
        //反选
        function checkReverse() {
            $(".check ").each(function () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", !($(this).attr("checked")));
                }
            });
        }
        function checkRemove() {
            $(".check ").each(function () {
                var able = $(this).attr("disabled");
                if (able != 'disabled') {
                    $(this).attr("checked", false);
                }
            });
        }
    </script>
    <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="title" runat="server" Title="代理集包中转列表">
        <ShortCuts>
            <%-- <a href="javascript:prn3_preview()" ><%=GetText("新版打印预览") %></a>--%>
        </ShortCuts>
    </yee:PageTitle>
    <yee:MessageBox ID="msg" runat="server"></yee:MessageBox>

    <div>
        <yee:TabControl ID="tabAir" runat="server">
        </yee:TabControl>
        <asp:Button ID="btnPiPrint" runat="server" CssClass="button" Text="批量打印" />

        <asp:Repeater ID="rptClaim" runat="server" OnItemDataBound="rptClaim_ItemDataBound">
            <HeaderTemplate>
                <table cellpadding="0" class="table" cellspacing="0" border="0" id="table1" style="text-align: center;">
                    <tr>
                        <%--<td class="tbheader" width="30px">
                            <input type="checkbox" id="checkboxAll" onclick="check_all_not()" />
                        </td>--%>
                        <td class="tbheader" align="center" width="80px">
                            <%=GetText("序号") %>
                        </td>
                        <td class="tbheader" align="center" width="80px">
                            <%=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="200px">
                            <%=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="100px">
                            <%=GetText("体积") %>
                        </td>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("运输方式") %>
                        </td>
                        <td class="tbheader" align="center" width="100px">
                            <%=GetText("箱子数") %>
                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tbrow">
                    <%-- <td class="tbpost" style="text-align: center;">
                        <input type="checkbox" id="cbItem" runat="server" class="check" value='<%#Eval("CollectUniqueId") %>' />
                    </td>--%>
                    <td class="tbpost">
                        <asp:Literal ID="litSort" runat="server"></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%#Eval("WarehouseName") %>
                    </td>
                    <td class="tbpost">

                        <asp:HyperLink ID="hlOrderNo" runat="server" Text='<%# Eval("CTWOrderNo")%>'></asp:HyperLink>
                        <asp:HiddenField ID="hfId" runat="server" Value='<%#Eval("CollectUniqueId") %>' />
                    </td>
                    <td class="tbpost">
                        <%#Eval("SignInOn") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("StockOutOn") %>
                    </td>
                    <td class="tbpost">
                        <asp:HyperLink ID="hlSerialNo" runat="server"></asp:HyperLink>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Weight")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Volume")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("FreightType")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("BoxCount")%>
                        <asp:Label ID="labUnSignCount" runat="server" Text='<%# Eval("UnSignCount")%>'></asp:Label>
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="tbrowalter">
                    <%-- <td class="tbpost" style="text-align: center;">
                        <input type="checkbox" id="cbItem" runat="server" class="check" value='<%#Eval("CollectUniqueId") %>' />
                    </td>--%>
                    <td class="tbpost">
                        <asp:Literal ID="litSort" runat="server"></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%#Eval("WarehouseName") %>
                    </td>
                    <td class="tbpost">

                        <asp:HyperLink ID="hlOrderNo" runat="server" Text='<%# Eval("CTWOrderNo")%>'></asp:HyperLink>
                        <asp:HiddenField ID="hfId" runat="server" Value='<%#Eval("CollectUniqueId") %>' />
                    </td>
                    <td class="tbpost">
                        <%#Eval("SignInOn") %>
                    </td>
                    <td class="tbpost">
                        <%#Eval("StockOutOn") %>
                    </td>
                    <td class="tbpost">
                        <asp:HyperLink ID="hlSerialNo" runat="server"></asp:HyperLink>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Weight")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Volume")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("FreightType")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("BoxCount")%>
                        <asp:Label ID="labUnSignCount" runat="server" Text='<%# Eval("UnSignCount")%>'></asp:Label>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <script type="text/javascript">
        $(
            function () {
                if ($("#table") != null) {
                    $("#table tbody tr").mouseover(function () {
                        $(this).find("td").css("background-color", "yellow");
                    }).mouseout(function () {
                        $(this).find("td").removeAttr("style");
                    }
                    )
                }
            }
        );
    </script>
    <script language="javascript" type="text/javascript">

        var LODOP; //声明为全局变量

        function prn_print_list(recordid, ware) {

            $.ajax({
                async: false, url: "../Ajax/StockCollectOrderList.ashx", data: { uniqueid: recordid, wareid: ware }, success: function (data) {

                    flag = CreateNormalFormPageList(data);

                }
            });

            if (flag) {
                //window.location.reload();
                alert('打印成功');
            }
        };

        function prn3_preview() {

            CreateOneFormPageBy2019();
            //LODOP.PREVIEW();
            LODOP.PRINT_DESIGN();
        };

        function CreateNormalFormPageList(data) {

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

            var arrList = eval(data);
            var listLen = parseInt(arrList.length);
            for (var j = 0; j < listLen; j++) {
                var arr = eval(arrList[j]);

                var cnname = arr.WareCnName;
                var enname = arr.WareEnName;
                var khname = arr.WareKhName;
                var mobile = arr.Mobile;
                var orderno = arr.CollectSerialNo;

                LODOP.PRINT_INITA(0, 0, 377, 374, "");
                LODOP.SET_PRINT_PAGESIZE(0, 1000, 1000, "A4");
                LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
                LODOP.ADD_PRINT_RECT(2, 5, 369, 85, 0, 1);
                LODOP.ADD_PRINT_RECT(87, 5, 116, 83, 0, 1);
                LODOP.ADD_PRINT_RECT(87, 120, 254, 83, 0, 1);
                LODOP.ADD_PRINT_RECT(169, 5, 116, 53, 0, 1);
                LODOP.ADD_PRINT_TEXT(8, 106, 127, 40, "LODA");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 26);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_RECT(221, 5, 116, 53, 0, 1);
                LODOP.ADD_PRINT_RECT(274, 5, 116, 93, 0, 1);
                LODOP.ADD_PRINT_RECT(169, 120, 254, 53, 0, 1);
                LODOP.ADD_PRINT_RECT(221, 120, 254, 53, 0, 1);
                LODOP.ADD_PRINT_RECT(274, 120, 254, 93, 0, 1);
                LODOP.ADD_PRINT_TEXT(53, 65, 207, 35, "【国际件】中转面单");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(97, 13, 100, 30, "收件方");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(130, 12, 100, 30, "联系电话");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(90, 128, 241, 30, khname);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(119, 129, 239, 25, cnname + "（" + enname + "）");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(144, 128, 240, 20, mobile);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(182, 12, 100, 35, "批号");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(231, 9, 100, 40, "备注");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(179, 127, 234, 40, orderno);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(227, 126, 238, 46, "");
                LODOP.ADD_PRINT_TEXT(281, 10, 100, 35, "寄件方");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(319, 10, 100, 30, "联系电话");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(275, 127, 240, 30, "ភ្នំពេញ");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(304, 126, 239, 30, "金边总部（Phonm Penh）");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
                LODOP.ADD_PRINT_TEXT(334, 127, 237, 25, "077255510");
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
                LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

                //LODOP.SET_PRINTER_INDEXA("outPrinterGK888t")
                //LODOP.PRINTA();
                LODOP.PRINT();

            }

            return true;

        };

        function CreateOneFormPageBy2019() {

            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INITA("打印中转面单");

            LODOP.PRINT_INITA(0, 0, 377, 374, "");
            LODOP.SET_PRINT_PAGESIZE(0, 1000, 1000, "A4");
            LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
            LODOP.ADD_PRINT_RECT(2, 5, 369, 85, 0, 1);
            LODOP.ADD_PRINT_RECT(87, 5, 116, 83, 0, 1);
            LODOP.ADD_PRINT_RECT(87, 120, 254, 83, 0, 1);
            LODOP.ADD_PRINT_RECT(169, 5, 116, 53, 0, 1);
            LODOP.ADD_PRINT_TEXT(8, 106, 127, 40, "LODA");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 26);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_RECT(221, 5, 116, 53, 0, 1);
            LODOP.ADD_PRINT_RECT(274, 5, 116, 93, 0, 1);
            LODOP.ADD_PRINT_RECT(169, 120, 254, 53, 0, 1);
            LODOP.ADD_PRINT_RECT(221, 120, 254, 53, 0, 1);
            LODOP.ADD_PRINT_RECT(274, 120, 254, 93, 0, 1);
            LODOP.ADD_PRINT_TEXT(53, 65, 207, 35, "【国际件】中转面单");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(97, 13, 100, 30, "收件方");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(130, 12, 100, 30, "联系电话");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(90, 128, 241, 30, "国公站柬文");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(119, 129, 239, 25, "国公站（Koh Kong）");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(144, 128, 240, 20, "090620520");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(182, 12, 100, 35, "批号");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(231, 9, 100, 40, "备注");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(179, 127, 234, 40, "FS19082151");
            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(227, 126, 238, 46, "");
            LODOP.ADD_PRINT_TEXT(281, 10, 100, 35, "寄件方");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(319, 10, 100, 30, "联系电话");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(275, 127, 240, 30, "ភ្នំពេញ");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(304, 126, 239, 30, "金边总部（Phonm Penh）");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(334, 127, 237, 25, "077255510");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.SET_PRINTER_INDEXA("outPrinterGK888t")

        };

        function CreateOneFormPageBy2018() {

            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INITA("打印外箱条码");

            LODOP.PRINT_INITA(0, 0, 393, 256, "");
            LODOP.SET_PRINT_PAGESIZE(0, 1000, 1000, "A4");
            LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);

            LODOP.ADD_PRINT_TEXT(26, 15, 362, 51, "LODA");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 27);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(88, 9, 383, 35, "【国际件】中转面单");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(145, 10, 102, 55, "收件方\n联系电话");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(140, 124, 269, 58, "国公站（Koh Kong）\n090620520");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(222, 14, 105, 30, "批号");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(221, 126, 258, 30, "FS190821100");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(260, 12, 105, 30, "备注");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(259, 115, 274, 35, "");
            LODOP.ADD_PRINT_TEXT(302, 11, 100, 51, "寄件方\n联系电话");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(297, 112, 262, 60, "金边总部（Phnom Penh）\n077255510");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.SET_PRINTER_INDEXA("outPrinterGK888t")

        };
    </script>
</asp:Content>