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

<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="title" runat="server" Title="柜号签收"></yee:PageTitle>
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <table cellpadding="0" cellspacing="0" border="0" class="table">

        <tr>
            <td class="tbpostheader">
                <%=GetText("柜号") %>：
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtExpressNo" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tbpostheader">
                <%=GetText("库区") %>：
            </td>
            <td class="tbpost">
                <asp:DropDownList runat="server" ID="ddlStorageId" ></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="tbfooter"></td>
            <td class="tbfooter">
                <yee:Button ID="btnCheck" CssClass="button" runat="server" OnClick="btnCheck_Click" Text="扫描柜号" />
                <yee:Button ID="btnPrint" CssClass="button" runat="server" OnClick="btnPrint_Click" Text="打印" />
                <yee:Button ID="btnPreview" CssClass="button" runat="server" OnClick="btnPreview_Click" Text="打印预览" />
            </td>
        </tr>
    </table>
    <script language="javascript" type="text/javascript">
        var LODOP; //声明为全局变量

        function carCabinet_print(date, id) {

            $.get("../Ajax/GetWareCollectInfoByCarRecord.ashx", { id: id }, function (data) {

               
                    PrintByRecord(date,data);
                    LODOP.PRINT();

            });
        }
        function carCabinet_preview(date, id) {

            $.get("../Ajax/GetWareCollectInfoByCarRecord.ashx", { id: id }, function (data) {
                PrintByRecord(date,data);
                LODOP.PREVIEW();
            });
        }
        function PrintByRecord(date,data) {

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

            var record = eval(data);

            var arr = eval(record.Details);
            var len = parseInt(arr.length);

            //alert(len);

            ////PMingLiU  SimSun
            var htmlstr = "<table style=\"font-size:12px;text-align:center;font-family:SimSun;font-weight:100\">";
            htmlstr += "<tr> <td style=\"border-top: 1px solid black;\" >启运日期</td><td style=\"border-top: 1px solid black;\" >" + record.StockOutOn + "</td></tr>";
            htmlstr += "<tr><td  >柜号</td><td> " + record.CabinetNo + "</td></tr>";
            htmlstr += "<tr><td  >到柜日期</td><td >" + date + "</td></tr>";
            for (var i = 0; i < len; i++) {

                htmlstr += "<tr><td style=\"border-top: 1px solid black;\"  colspan=\"2\">" + arr[i].Ware + "</td></tr>";
                htmlstr += "<tr><td >货物类型</td><td >" + arr[i].Type + "</td></tr>";
                htmlstr += "<tr><td >货物数量</td><td >" + arr[i].TypeCount + "</td></tr>";
                htmlstr += "<tr><td >总重量</td><td >" + arr[i].Weight + "</td></tr>";
                htmlstr += "<tr><td >总体积</td><td >" + arr[i].Volume + "</td></tr>"; 
                

            }
            htmlstr += "</table>";
             

            LODOP.PRINT_INITA(-5, -5, 197, 720, "");
            LODOP.SET_PRINT_PAGESIZE(3, 520, 0, "CreateCustomPage");
            LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
            LODOP.ADD_PRINT_HTM("13.15mm", "10.711%", "55.01mm", "689.972%", htmlstr);
            LODOP.ADD_PRINT_TEXT(9, 30, 140, 30, "柜号确认");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);


            LODOP.SET_PRINTER_INDEXA("outPrinterAB58GK");
            //LODOP.PRINT();
            //LODOP.PRINT_DESIGN();
            //LODOP.PRINT();
            //LODOP.PREVIEW();
        };
    </script>
</asp:Content>