<%@ Page Title="" Language="C#" MasterPageFile="~/StockOut/Site1.Master" AutoEventWireup="true" CodeBehind="AbroadCollectBoxEdit.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.StockOut.AbroadCollectBoxEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%=GetText("海外装箱") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <title><%=GetText("海外装箱") %></title>
    <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>
    <script type="text/javascript">

        function Chose_Click() {
            // $("#iframeBox").dialog("open");g
            var customerCode = $("#hfCustomerCode").val();

            $("#BoxIframe").attr("src", "ChoseBox.aspx?customerCode=" + customerCode);
            $("#iframeBox").dialog({
                autoOpen: true,
                resizable: false,
                width: 1000,
                modal: true,
                title: "选择箱子",
                buttons: {
                    "确认": function () {
                        var box = $("#BoxIframe").contents().find("#cbItem:checked").val();
                        var orderNo = $("#BoxIframe").contents().find("#cbItem:checked").next().val();

                        if (box == undefined) {
                            alert("请选择选择箱子");
                            return false;
                        }
                        $("#labBoxSerial").text(box);
                        $("#hfBoxSerial").val(box);

                        $(this).dialog("close");

                    },
                    "取消": function () {

                        $(this).dialog("close");
                    }
                }
            });


            return false;
        }

        $(function () {
            $("#iframeBox").dialog({
                title: '选择箱子',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: $("#BoxIframe").width() + 20,
                modal: true
            });
        });
    </script>
   
      <style type="text/css">
        .BoxIframe
        {
            width:1000px;
            height:300px;    
            }
        .input-size
        {
            width:100px;
            }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <yee:PageTitle ID="title" runat="server" ></yee:PageTitle>
      <yee:MessageBox ID="msg" runat="server" ></yee:MessageBox>
   
   
    <asp:Repeater ID="rptList" runat="server">
        <HeaderTemplate>
            <table cellpadding="0" cellspacing="0" border="0" class="table">
                <tr>
                    <td class="tbheader">
                        <%=GetText("出库时间") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("出库单号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("客户代号") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td class="tbpost">
                    <%#Eval("CreatedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("StockOutSerialNo")%>
                   
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>

                </td>
                <asp:HiddenField ID="hidStockOrderId" Value='<%#Eval("StockOutOrderId") %>' runat="server" />
                <asp:Literal ID="litOutModifiedOn" runat="server" Text='<%#Yee.Utilities.Helpers.DisplayHelper.RetainMiliseconds(Eval("ModifiedOn"))%>' Visible="false"></asp:Literal>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <asp:Repeater ID="rptStockInList" runat="server">
        <HeaderTemplate>
            <table cellpadding="0" cellspacing="0" border="0" class="table">
                <tr>
                    <td class="tbheader">
                        <%=GetText("入库时间") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("入库单号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("客户代号") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td class="tbpost">
                    <%#Eval("CreatedOn") %>
                </td>
                <td class="tbpost">
                    <%# Eval("StockInSerialNo")%>
                   
                </td>
                <td class="tbpost">
                    <%# Eval("CustomerCode")%>

                </td>
                <asp:HiddenField ID="hidStockInOrderId" Value='<%#Eval("StockInOrderId") %>' runat="server" />
                <asp:Literal ID="litInModifiedOn" runat="server" Text='<%#Yee.Utilities.Helpers.DisplayHelper.RetainMiliseconds(Eval("ModifiedOn"))%>' Visible="false"></asp:Literal>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <table cellpadding="0" cellspacing="0" border="0" class="table">
        <tr>
            <td class="tbpostheader">
                <%=GetText("重量") %>
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtBoxWeight" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtBoxWeight" ErrorMessage="输入格式不正确" 
                    ValidationExpression="^\d*\.{0,1}\d{0,3}$"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="tbpostheader">
                <%=GetText("体积") %>
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtBoxVolume" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtBoxVolume" ErrorMessage="输入格式不正确" 
                    ValidationExpression="^\d*\.{0,1}\d{0,3}$"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="tbpostheader">
                <%=GetText("海关类目") %>
            </td>
            <td class="tbpost">
                <asp:DropDownList ID="ddlCata" runat="server"  AutoPostBack="true"
                    onselectedindexchanged="ddlCata_SelectedIndexChanged"></asp:DropDownList> <asp:DropDownList ID="ddlSubCata" runat="server" ></asp:DropDownList> <asp:TextBox ID="txtSubCataName" runat="server"  Width="200px"></asp:TextBox>
            </td>
        </tr>
         <tr>
            <td class="tbpostheader">
              <%=GetText("是否牌子") %>  
            </td>
            <td class="tbpost">
              <asp:CheckBox ID="cbIsBrand" runat="server" /> 
            </td>
        </tr>
        <tr>
            <td class="tbpostheader">
              <%=GetText("箱子类型") %>
            </td>
            <td class="tbpost">
                <yee:DictionaryRadios ID="rblBoxType" runat="server" Dictionary="BoxTypes"  RepeatDirection="Horizontal" IsFirstSelected="true" AutoPostBack="true"  OnSelectedIndexChanged="BoxType_IndexChanged"></yee:DictionaryRadios> 
            </td>
        </tr>
        <tr runat="server" id="display">
            <td class="tbpostheader">
                <%=GetText("打木箱费用") %>
            </td>
            <td class="tbpost">
                <asp:TextBox ID="txtBoxCost" runat="server" Text="0" ClientIDMode="Static"></asp:TextBox> 
                <asp:DropDownList ID="ddlCurrency" runat="server" ></asp:DropDownList>
            </td>
        </tr>
        <tr runat="server" id="Tr1">
            <td class="tbpostheader">
                <%=GetText("品质") %>
            </td>
            <td class="tbpost">
                <asp:DropDownList ID="ddlCommonMode" runat="server" ></asp:DropDownList>
            </td>
        </tr>
        <tr >
            <td class="tbpostheader">
                <%=GetText("箱子流水号") %>
            </td>
            <td class="tbpost">
                 <asp:Label ID="labBoxSerial" runat="server" ClientIDMode="Static" CssClass="input-size"></asp:Label>
                 <asp:HiddenField ID="hfBoxSerial" runat="server" ClientIDMode="Static" />
                 <a href="javascript:void(0)"  runat="server" id="choseBox" onclick="Chose_Click()" >选择箱子</a>(未选择箱子的时候，会自动生成)
                <asp:HiddenField ID="hfWarehouseId" runat="server"  />
                <asp:HiddenField ID="hfTargetWarehouseId" runat="server" />
                <asp:HiddenField ID="hfCustomerCode" runat="server"  ClientIDMode="Static"/>
              </td>
        </tr>
       
        <tr>
            <td class="tbfooter" colspan="2">
                <asp:Button ID="btSaveBoxOut" CssClass="button" runat="server"  OnClientClick='return confirm("确定装箱？？？")'
                    onclick="btSaveBoxOut_Click" />

                <asp:Button ID="btSaveBoxIn" CssClass="button" runat="server" OnClientClick='return confirm("确定装箱？？？")'
                    onclick="btSaveBoxIn_Click" />
            </td>
        </tr>

    </table>
     <asp:HiddenField ID="hfStockOutOrderId" runat="server" ClientIDMode="Static" />
     <asp:HiddenField ID="hfStockOutUniqueId" runat="server" ClientIDMode="Static" />
     
     <div id="iframeBox" class="iframeBox">
        <div id="progressBarBackground" class="progressBarBackground" style="display: none;">
        </div>
        <div id="progressBar" class="progressBar" style="display: none;">
            数据加载中，请稍等...</div>
        <iframe id="BoxIframe" frameborder="0" class="BoxIframe"></iframe>
    </div>
  
     <script language="javascript" type="text/javascript">


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

             CreateOneFormPage();
             LODOP.PREVIEW();
             //LODOP.PRINT_DESIGN();
         };
         function prn1_print(serialNo, customerCode, orderNo, createdOn, employNo) {
             CreateOneFormPage(serialNo, customerCode, orderNo, createdOn, employNo);
             LODOP.PRINT();

             var uniqueid = $("#hfStockOutUniqueId").val();
             if (uniqueid.length > 0) {
                 window.location.href = 'StockOutOrderDetailsList.aspx?uniqueId=' + uniqueid;
             }
             else {
                 window.location.href = 'StockOutOrdersList.aspx';
             }
         };
         function prn1_printA() {
             CreateOneFormPage();
             LODOP.PRINTA();
         };
         function CreateOneFormPage(serialNo, customerCode, orderNo, createdOn, employNo) {

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


             LODOP.ADD_PRINT_BARCODE(36, 45, 228, 40, "128A", serialNo);
             LODOP.ADD_PRINT_TEXT(84, 41, 247, 25, "客户代号  " + customerCode);
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_TEXT(109, 41, 250, 25, "会员单号  " + orderNo);
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_TEXT(134, 41, 250, 25, "装箱时间  " + createdOn);
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_ELLIPSE(162, 62, 49, 31, 0, 1);
             LODOP.ADD_PRINT_TEXT(168, 72, 49, 22, employNo);
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

             LODOP.SHOW_CHART();

         };


        </script>
</asp:Content>
