<%@ Page Title="" Language="C#" MasterPageFile="~/StockIn/Site.Master" AutoEventWireup="true" CodeBehind="AbroadStockInOrderDetail.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.StockIn.AbroadStockInOrderDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" 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 SetStatu_click(id) {
            $("#iframeEdit").dialog("open");
            $("#EditIframe").attr("src", "SetAmount.aspx?id=" + id);

            //return false;
        }
        $(function () {
            $("#iframeEdit").dialog({
                title: '设置重量/体积/容量',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: $("#EditIframe").width() + 20,
                modal: true
            });
        });
        function check_cb() {
            var num = $(".check:checked").length;
            if (num == 0) {
                alert("请勾选数据行");
            }
            if (confirm("确定生成新的箱子号？？？")) {
                return true;
            }
            else {
                return false;
            }
        }

        function deleteStock(id) {
            $("#iframeBox").dialog("open");
            $("#boxIframe").attr("src", "../Orders/ChoseDataReason.aspx?StockIn=" + id);

            return false;
        }
        $(function () {
            $("#iframeBox").dialog({
                title: '删除入库单',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: $("#boxIframe").width() + 20,
                modal: true
            });
        });
        //设置库位弹出框
        $(function () {
            $("#iframeSetLocationBox").dialog({
                title: '移库',
                modal: true,
                autoOpen: false,
                width: $("#ifSetLocation").width() + 20,
                //height: 200,
                resizable: false
            })
        });
        function setLocation() {
            $("#iframeSetLocationBox").dialog("open");
            $("#ifSetLocation").attr("src", "SetStockInLocation.aspx?uniqueId=" + "<%=Request["uniqueId"]%>");
        }

    </script>
    <style type="text/css">
        #EditIframe {
            width: 500px;
            height: 250px;
        }

        #boxIframe {
            width: 500px;
            height: 250px;
        }

        #ifSetLocation {
            width: 650px;
            height: 250px;
        }

        .trace {
            float: left;
            width: 480px;
            min-height: 300px;
            border: solid 1px #ccc;
        }

        .stock {
            float: right;
            width: 700px;
            min-height: 300px;
            border: solid 1px #ccc;
        }

        .hf_css {
            border-radius: 23px;
            -webkit-border-radius: 23px;
            -moz-border-radius: 23px;
            -o-border-radius: 23px;
            margin-bottom: 5px;
            margin-right: 5px;
            padding: 0.2em 0.4em;
            border: solid 1px black;
        }

        .auto-style1 {
            height: 30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <div class="subheader">
        <div class="title">
            <%=GetText("入库单号") %>--<asp:Literal ID="litStockInSerialNo" runat="server" ClientIDMode="Static"></asp:Literal>
        </div>
        <div class="command">
            <a href="javascript:void(0)" id="setStatu" runat="server"><%=GetText("设置重量/体积/容量") %></a>
            <a href="javascript:prn1_preview()"><%=GetText("打印预览入库标签") %></a>
            <a href="javascript:prn1_print()"><%=GetText("直接打印入库标签") %></a>                
        </div>
        <div style="clear: both;">
        </div>
    </div>
    <div>
        <table cellpadding="0" cellspacing="0" border="0" class="table">
            <tr>
                <td class="tbpostheader">
                    <%=GetText("入库单号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litStockInNo" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("入库时间") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCreatedOn" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("入库人") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCreatedByName" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("店铺名称") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litShopName" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("会员订单号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCustomerOrderNo" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("库位") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litLocation" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("客户代号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCustomerCode" runat="server"></asp:Literal>（<asp:Literal ID="litCustomerName"
                        runat="server"></asp:Literal>）
                </td>
                <td class="tbpostheader">
                    <%=GetText("采购CS") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litPurchaseCsName" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("采购订单号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litPurchaseOrderNo" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("重量") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litWeight" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("体积") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litVolume" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("箱子号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litBox" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("出库状态") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litStockOutStatu" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("出库操作人") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litStockByName" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("出库时间") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litStockOn" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("出库设置") %>：
                </td>
                <td class="tbpost">
                    <asp:CheckBox ID="cbIsNormalStockOut" runat="server" Text="正常出库" OnCheckedChanged="cbIsNormalStockOut_CheckedChanged" AutoPostBack="true"/> 

                    <yee:DictionaryRadios ID="rblStockIn" Dictionary="StockInTypes" runat="server" IsFirstSelected="true"  ></yee:DictionaryRadios>

                    <asp:Button ID="btnChangeStockOut" runat="server" Text="出库设置" OnClick="btnChangeStockOut_Click" CssClass="button" OnClientClick="return confirm('确定操作出库设置？')" />
                </td>
                <td class="tbpostheader">
                    QC备注：
                </td>
                <td class="tbpost"> 
                   <asp:TextBox ID="txtQCRemark" runat="server"  TextMode="MultiLine"></asp:TextBox>
                    <br/>
                   <asp:Button ID="btSaveRemark" runat="server" Text="编辑备注信息" CssClass="button" OnClick="btSaveRemark_Click"  OnClientClick="return confirm('编辑备注信息')"/>
                </td>
                <td class="tbpostheader" colspan="2"; style="text-align:center">    
                    <input type="button" value="移库" class="button"  onclick="setLocation()" />            
                </td>
            </tr>
        </table>
    </div>
    <div class="query" id="display" runat="server">
        <table cellpadding="5" cellspacing="10" width="100%" border="0">
            <tr>
                <td>
                    <strong><%=GetText("退货信息") %></strong>
                </td>
            </tr>
            <tr>
                <td class="queryLeft">
                    <%=GetText("快递单号") %>：
                </td>
                <td>
                    <asp:TextBox ID="txtExpressNo" CssClass="noNull" runat="server"></asp:TextBox>
                </td>
                <td class="queryLeft">
                    <%=GetText("快递公司") %>：
                </td>
                <td>
                    <asp:DropDownList ID="ddlExpressCompany" runat="server" DataTextField="CompanyName"
                        DataValueField="CompanyId" >
                    </asp:DropDownList>
                </td>
                <td class="queryLeft">
                    <%=GetText("收货人名称") %>：
                </td>
                <td class="inputBigTxt">
                    <asp:TextBox ID="txtReceiverName" CssClass="noNull" runat="server" Enabled="false"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="queryLeft">
                    <%=GetText("收货人手机") %>：
                </td>
                <td>
                    <asp:TextBox ID="txtMobile" runat="server" Enabled="false"></asp:TextBox>
                </td>
                <td class="queryLeft">
                    <%=GetText("运费支付模式") %>：
                </td>
                <td>
                    <asp:DropDownList ID="ddlFreightMode" runat="server" Enabled="false">
                    </asp:DropDownList>
                </td>
                <td class="queryLeft">
                    <%=GetText("运费金额") %>：
                </td>
                <td>
                    <asp:TextBox ID="txtFreightAmount" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtFreightAmount"
                        ErrorMessage="请输入正确的格式" ValidationExpression="^\d*\.{0,1}\d{0,4}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="queryLeft">
                    <%=GetText("收货人地址") %>：
                </td>
                <td colspan="7">
                    <asp:DropDownList ID="ddlCountry" runat="server" Enabled="false" AutoPostBack="true"
                        OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlRegion" runat="server" Enabled="false" AutoPostBack="true"
                        OnSelectedIndexChanged="ddlRegion_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlProvince" runat="server" Enabled="false" AutoPostBack="true"
                        OnSelectedIndexChanged="ddlProvince_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlCity" runat="server" Enabled="false" AutoPostBack="true"
                        OnSelectedIndexChanged="ddlCity_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlDistrict" runat="server" Enabled="false">
                    </asp:DropDownList>
                    <asp:TextBox ID="txtReceiverAddress" CssClass="noNull" Width="300px" runat="server"
                        Enabled="false"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="queryLeft">
                    <%=GetText("备注") %>：
                </td>
                <td colspan="6">
                    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" MaxLength="200" Width="60%"
                        Height="60px"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnFreight" runat="server" CssClass="button"  OnClientClick='return confirm("确定编辑异常出库包裹么？？？")'
                        OnClick="btnFreight_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        &nbsp;
    </div>
    <!-- 入单库追踪 -->
    <div>
        <div class="trace">
            <asp:Repeater ID="rptTracer" runat="server">
                <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td class="tbheader" width="">
                                <%=GetText("项目") %>
                            </td>
                            <td class="tbheader" width="">
                                <%=GetText("信息") %>
                            </td>
                            <td class="tbheader" width="100px">
                                <%=GetText("操作人") %>
                            </td>
                            <td class="tbheader" width="110px">
                                <%=GetText("操作时间") %>
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="tbrow">
                        <td class="tbpost">
                            <%#Eval("ProjectName")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("Message")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("Operater")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("OperaterOn")%>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="tbrowalter">
                        <td class="tbpost">
                            <%#Eval("ProjectName")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("Message")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("Operater")%>
                        </td>
                        <td class="tbpost">
                            <%#Eval("OperaterOn")%>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div class="stock">
            <table cellpadding="0" cellspacing="0" border="0">
            <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand" OnItemDataBound="rptList_ItemDataBound">
                <HeaderTemplate>                    
                        <tr>
                            <td class="tbheader" width="10px">
                            </td>
                            <td class="tbheader" width="500px" colspan="2">
                                <%=GetText("商品") %>
                            </td>
                            <td class="tbheader" width="100px">
                                <%=GetText("入库数量") %>
                            </td>
                            <td class="tbheader" width="100px">
                                <%=GetText("拆分数量") %>
                            </td>
                            <td class="tbheader" >
                                <%=GetText("是否打木箱") %>
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="tbrow">
                        <td class="tbpost">
                            <input type="checkbox" runat="server" id="cbItem" class="check" value='<%# Eval("OrderDetailsId") %>' />
                        </td>
                        <td class="tbpost">
                            <img class="goods-small-img" src='<%#Eval("PurchaseItem.GoodImgUrl") %>'  alt="默认"/>
                        </td>
                        <td class="tbpost">
                            <p>
                                <asp:HyperLink ID="hlkGood" runat="server" Target="_blank"></asp:HyperLink></p>
                            <p>
                                <asp:Literal ID="litSkuTitle" runat="server"></asp:Literal></p>
                        </td>
                        <td class="tbpost">
                            <asp:TextBox ID="txtQty" runat="server" Text='<%# Eval("Quantity")%>'  CssClass="input-small"></asp:TextBox>
                            <asp:HiddenField ID="hfQty" runat="server" Value='<%# Eval("Quantity")%>' />
                        </td>
                        <td class="tbpost">
                            <asp:TextBox ID="txtCutQty" runat="server" Text="0" CssClass="input-small"></asp:TextBox>
                        </td>
                        <td class="tbpost">
                            <asp:Literal ID="litIsNeedBox" runat="server" ></asp:Literal>
                        </td>

                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="tbrowalter">
                        <td class="tbpost">
                            <input type="checkbox" runat="server" id="cbItem" class="check" value='<%# Eval("OrderDetailsId") %>' />
                        </td>
                        <td class="tbpost">
                            <img class="goods-small-img" src='<%#Eval("PurchaseItem.GoodImgUrl") %>' alt="默认" />
                        </td>
                        <td class="tbpost">
                            <p>
                                <asp:HyperLink ID="hlkGood" runat="server"></asp:HyperLink></p>
                            <p>
                                <asp:Literal ID="litSkuTitle" runat="server"></asp:Literal></p>
                        </td>
                        <td class="tbpost">
                            <asp:TextBox ID="txtQty" runat="server" Text='<%# Eval("Quantity")%>'  CssClass="input-small"></asp:TextBox>
                            <asp:HiddenField ID="hfQty" runat="server" Value='<%# Eval("Quantity")%>' />
                        </td>
                        <td class="tbpost">
                            <asp:TextBox ID="txtCutQty" runat="server" Text="0" CssClass="input-small"></asp:TextBox>
                        </td>
                        <td class="tbpost">
                            <asp:Literal ID="litIsNeedBox" runat="server" ></asp:Literal>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <FooterTemplate>
                </FooterTemplate>
            </asp:Repeater>
            <tr>
                <td class="tbfooter" colspan="3" align="right">
                    <%=GetText("汇总数量") %>:
                </td>
                <td class="tbfooter">
                    <asp:Literal ID="litTotalCount" runat="server"></asp:Literal>
                </td>
                <td class="tbfooter" colspan="2">
                </td>
            </tr>
            </table>
            <div>
                &nbsp;
            </div>
            <asp:Button ID="btSave" runat="server"  CssClass="button" OnClientClick="return check_cb()"
                OnClick="btSave_Click" />

            <asp:Button ID="btnSaveOwnless" runat="server" CssClass="button"  OnClientClick="return confirm('确定拆箱么？')" OnClick="btnSaveOwnless_Click" />

            <asp:Button ID="btnSaveEdit" runat="server" CssClass="button" OnClientClick="return confirm('确定释放入库数量？')" OnClick="btnSaveEdit_Click" />

        </div>
        <asp:Button ID="btnDelete" runat="server"  CssClass="button" />
    </div>
    <div style="clear: both;">
    </div>
    <asp:HiddenField ID="hfOrderNo" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="hfCustomerCode" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="hfQty" ClientIDMode="Static" runat="server" />
    <asp:HiddenField ID="hfLocation" ClientIDMode="Static" runat="server" />

    <asp:HiddenField ID="hfQcNum" ClientIDMode="Static" runat="server" />
    <div id="iframeEdit" class="iframeEdit">
        <iframe id="EditIframe" frameborder="0" class="EditIframe"></iframe>
    </div>
    <div id="iframeBox" class="iframeBox">
        <iframe id="boxIframe" frameborder="0" class="boxIframe"></iframe>
    </div>
  <div id="iframeSetLocationBox" style="height:280px" >
      <iframe id="ifSetLocation" frameborder="0"></iframe>
  </div>
     <script language="javascript" type="text/javascript">


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

             CreateOneFormPage();
             LODOP.PREVIEW();
             //LODOP.PRINT_DESIGN();
         };
         function prn1_print() {
             CreateOneFormPage();
             LODOP.PRINT();
         };
         function prn1_printA() {
             CreateOneFormPage();
             LODOP.PRINTA();
         };
         function CreateOneFormPage() {

             LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
             LODOP.PRINT_INIT("打印入库单");
             var orderNo = $("#hfOrderNo").val();
             var customerCode = $("#hfCustomerCode").val();
             var qty = $("#hfQty").val();
             var location = $("#hfLocation").val();
             var num = $("#hfQcNum").val();
             LODOP.ADD_PRINT_BARCODE(7, 14, 174, 40, "128A", orderNo);

             LODOP.ADD_PRINT_TEXT(52, 14, 136, 25, customerCode);
             LODOP.SET_PRINT_STYLEA(0, "FontName", "微软雅黑");
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_TEXT(68, 15, 137, 21, location);
             LODOP.SET_PRINT_STYLEA(0, "FontName", "微软雅黑");
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_TEXT(88, 15, 138, 25, qty);
             LODOP.SET_PRINT_STYLEA(0, "FontName", "微软雅黑");
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

             LODOP.ADD_PRINT_TEXT(58, 147, 53, 24, num);
             LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
             LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
             LODOP.ADD_PRINT_ELLIPSE(52, 144, 34, 30, 0, 0);
             LODOP.SHOW_CHART();

         };


        </script>
</asp:Content>
