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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>配送详情
    </title>
    <style>
        tabelNew {
            border-collapse: collapse;
            border-style: double;
            border-width: 3px;
            border-color: black;
        }

        tdNew {
            border-width: 1px;
            border-style: solid;
        }
    </style>
    <script type="text/javascript">

        function assignedQc(id, wareId) {
            $("#iframeUser").dialog("open");
            $("#userIframe").attr("src", "AbroadChoseqc.aspx?id=" + id + "&wareId=" + wareId);

            return false;
        }

        $(function () {
            $("#iframeUser").dialog({
                title: '分配拣货员',
                autoOpen: false,
                resizable: false,
                //height: 600,
                width: 400,
                modal: true
            });
        });
    </script>
    <style type="text/css">
        #userIframe {
            width: 400px;
            height: 250px;
        }

        .color {
            background: yellow !important;
        }

        .messagebox {
            font-size: 20px;
        }

        .auto-style1 {
            width: 44px;
        }
    </style>
    <script language="javascript" src="../lodop/LodopFuncs.js"></script>
    <script language="javascript" src="../lodop/CLodopfuncs.js"></script>
    <script language="javascript" type="text/javascript" src="../Scripts/PrintTemplate.js"></script>
    <style>
        @font-face {
            font-family: 'KhmerOSFont';
            src: url('../Scripts/KhmerOS.ttf') format('truetype');
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="subheader">
        <div class="title">
            <%=GetText("配送详情") %>
        </div>
        <div class="command">

            <asp:Button ID="btnPeiSongXiaoPiao" runat="server" Text="小票打印配送信息" CssClass="button" OnClick="btnPeiSongXiaoPiao_Click" />
            <asp:Button ID="btnPeiSongXiaoPiaoPreview" runat="server" Text="小票打印配送信息预览" CssClass="button" OnClick="btnPeiSongXiaoPiaoPreview_Click" />
          
            <asp:Button ID="btnPrint" runat="server" Text="70*50热敏打印" CssClass="button" OnClick="btnPrint_Click" />
            <asp:Button ID="btnPrintZiTi" runat="server" Text="小票打印自提单" CssClass="button" OnClick="btnPrintZiTi_Click" /> 
            <asp:Button ID="btnPrintZhuan" runat="server" Text="转单打印" CssClass="button" OnClick="btnPrintZhuan_Click" />
            <asp:Button ID="btnInputFailedReasons" runat="server" Text="妥投失败原因" CssClass="button" OnClick="btnInputFailedReasons_Click" />
        </div>
        <div style="clear: both"></div>
    </div>
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <div>
        <table class="table" cellpadding="0" cellspacing="0" border="0">

            <tr>
                <td class="tbpostheader">
                    <%=GetText("配送流水号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litSerialNo" runat="server"></asp:Literal>
                    <yee:Button ID="btnRelease" runat="server" Text="乐达配送作废" OnClick="btnRelease_Click" />
                    <yee:Button ID="btnRoll" runat="server" Text="返回上一步状态" OnClick="btnRoll_Click" />
                </td>
                <td class="tbpostheader">
                    <%=GetText("客户代号") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCustomerCode" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("快递公司") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litCompany" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("快递单号") %>：
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtExpressNo" runat="server"></asp:TextBox>
                    <yee:Button ID="btnChangeExpress" runat="server" Text="更改第三方配送" OnClick="btnChangeExpress_Click" />
                    <yee:Button ID="btnEditExpress" runat="server" Text="编辑快递单" OnClick="btnEditExpress_Click" />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("收货人") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litReceiveName" runat="server"></asp:Literal>
                </td>
                <td class="tbpostheader">
                    <%=GetText("拣货员") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litAssignedByName" runat="server"></asp:Literal>
                    <asp:Button ID="btnChoseQc" runat="server" CssClass="button" Text="分配拣货员"></asp:Button>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("联系电话") %>：
                </td>
                <td class="tbpost" >
                    <asp:Literal ID="litMobile" runat="server"></asp:Literal>
                </td>
                 <td class="tbpostheader">
                    <%=GetText("设置转仓包裹") %>：
                </td>
                <td class="tbpost" >
                    <asp:CheckBox ID="cbSetPackage" runat="server" OnCheckedChanged="cbSetPackage_CheckedChanged"  AutoPostBack="true" />
                    <div  id="dis_zhuan" runat="server">
                                <asp:DropDownList ID="ddlTargetWare" runat="server" ></asp:DropDownList>
                        <yee:Button  ID="btnSetPackage" runat="server"  Text="保存"  OnClick="btnSetPackage_Click"/>
                        
                    </div>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("收货人地址") %>：
                </td>
                <td class="tbpost" colspan="3">
                    <asp:Literal ID="litAddress" runat="server"></asp:Literal>
                    <asp:TextBox ID="txtQcAddress" runat="server" Width="400" ClientIDMode="Static"></asp:TextBox>
                    <asp:Button ID="btnEditQcAddress" runat="server" Text="编辑地址" CssClass="button" OnClick="btnEditQcAddress_Click" />
                </td>
            </tr>
            <tr>
                <%-- <td class="tbpostheader">
                    <%=GetText("付给快递公司运费") %>：
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtFreightAmount" runat="server" ></asp:TextBox>
                </td>--%>
                <td class="tbpostheader">
                    <%=GetText("服务费") %>：
                </td>
                <td class="tbpost">
                    <asp:Literal ID="litHasFreight" runat="server"></asp:Literal>
                    <asp:Label ID="labPayMsg" runat="server"  Font-Size="Larger" ForeColor="Red"> </asp:Label>
                  
                    <yee:Button ID="btnCutFreight" runat="server" OnClick="btnCutFreight_Click" />
                     <yee:Button ID="btnZiTi" runat="server" OnClick="btnZiTi_Click" Text="配送转自提" />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("币种") %>：
                </td>
                <td class="tbpost" >
                    <asp:DropDownList ID="ddlCurrencyCode" runat="server" data-live-search="true" CssClass="selectpicker">
                    </asp:DropDownList>
                </td>
                <td class="tbpostheader">
                    <%=GetText("设置服务类型") %>：
                </td>
                <td class="tbpost" > 
                    <asp:RadioButtonList ID="rblServiceType" runat="server" RepeatDirection="Horizontal"    AutoPostBack="true" OnSelectedIndexChanged="rblServiceType_SelectedIndexChanged"></asp:RadioButtonList>
                     <asp:CheckBox ID="cbIsNotAgent" runat="server"  Text="无代理"   />
                     <yee:Button ID="btnUpServiceType" runat="server" Text="设置服务类型" OnClick="btnUpServiceType_Click" />
                    <yee:Button ID="btnCancelServiceType" runat="server" Text="取消服务类型" OnClick="btnCancelServiceType_Click" />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("备注") %>：
                </td>
                <td class="tbpost" colspan="5">
                    <asp:Literal ID="litRemark" runat="server"></asp:Literal> 
                </td>
            </tr>
            <tr>
                <td class="tbpostheader"></td>
                <td class="tbpost" colspan="3">
                    <yee:Button ID="btnSave" runat="server" Visible="false" OnClick="btnSave_Click" />
                    <asp:TextBox ID="txtReleaseCargoRemark" runat="server" Width="150px"></asp:TextBox>
                    <asp:Button ID="btnReleaseCargo" runat="server" OnClick="btnReleaseCargo_Click" CssClass="button" />
                </td>
            </tr>
        </table>
    </div>
   
    <asp:Repeater ID="rptBoxList" runat="server">
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0" id="table2" style="text-align: center;">
                <tr>
                    <td class="tbheader" align="center" width="200px">
                        <%=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="200px">
                        <%=GetText("国际运费") %>
                    </td>
                    <td class="tbheader" align="center" width="200px">
                        <%=GetText("本地运费") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <%# Eval("SerialNo")%>
                    <asp:HiddenField ID="hfBoxId" runat="server" Value='<%#Eval("BoxId") %>' />
                    <asp:HiddenField ID="hfNoticeId" runat="server" Value='<%#Eval("NoticeId") %>' />
                </td>
                <td class="tbpost">
                    <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost">
                    <%# Eval("OrderNo")%>
                </td>
                <td class="tbpost">
                    <%# Eval("InterFreight")%>
                </td>
                <td class="tbpost">
                    <%# Eval("AbroadFreight")%>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="tbrowalter">
                <td class="tbpost">
                    <%# Eval("SerialNo")%>
                    <asp:HiddenField ID="hfBoxId" runat="server" Value='<%#Eval("BoxId") %>' />
                    <asp:HiddenField ID="hfNoticeId" runat="server" Value='<%#Eval("NoticeId") %>' />
                </td>
                <td class="tbpost">
                    <%#Eval("CustomerCode") %>
                </td>
                <td class="tbpost">
                    <%# Eval("OrderNo")%>
                </td>
                <td class="tbpost">
                    <%# Eval("InterFreight")%>
                </td>
                <td class="tbpost">
                    <%# Eval("AbroadFreight")%>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <yee:PageTitle ID="PageTitle2" runat="server" Title="派送存档图片"></yee:PageTitle>

    <asp:Repeater ID="rptImg" runat="server">

        <ItemTemplate>
            <asp:Image ID="imgInfo" runat="server" ImageUrl=' <%# Eval("ImageUrl")%>' Width="300px" Height="300px" />
        </ItemTemplate>

        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <yee:PageTitle ID="PageTitle1" runat="server" Title="操作历史"></yee:PageTitle>
    <asp:Repeater ID="rptOp" runat="server">
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0" id="table2" style="text-align: center;">
                <tr>
                    <td class="tbheader" align="center" width="200px">
                        <%=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="200px">
                        <%=GetText("操作人工作仓") %>
                    </td>
                    <td class="tbheader" align="center" width="200px">
                        <%=GetText("原因") %>
                    </td>
                    <td class="tbheader" align="center" width="200px">
                        <%=GetText("备注") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <%# Eval("Status")%>
                </td>
                <td class="tbpost">
                    <%#Eval("OperationByName") %>
                </td>
                <td class="tbpost">
                    <%# Eval("OperationTime")%>
                </td>
                <td class="tbpost">
                    <%# Eval("OperationWarehouse")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Reason")%>
                </td>
                <td class="tbpost">
                    <%# Eval("Remark")%>
                </td>
            </tr>
        </ItemTemplate>

        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <div id="printDiv" style="display: none">
        <table border="1" width="230" style="text-align: center;">
            <tr>
                <td width="5%"></td>
                <td width="50%">
                    <asp:Literal ID="litTel" runat="server"></asp:Literal></td>
                <td width="45%">
                    <asp:Literal ID="litCode" runat="server"></asp:Literal></td>
            </tr>
            <asp:Repeater ID="rptPrintList" runat="server">
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("StorageCode")%>
                        </td>
                        <td>
                            <%# Eval("SerialNo")%>
                        </td>
                        <td>
                            <%#Eval("InterFreight") %>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
    <asp:HiddenField ID="hfName" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfTel" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfAddress" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfQcAddress" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfId" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfWebsite" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfBoxIds" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfLanguage" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfOrderNo" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfCustomerCode" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfReceiveName" runat="server" ClientIDMode="Static" />
     
    <div id="iframeUser" class="iframeUser">
        <iframe id="userIframe" frameborder="0" class="userIframe"></iframe>
    </div>

    <script language="javascript" type="text/javascript">
        /*
         *在用 配送小票打印
         */
        //配送小票打印
        function loda_huo_print(print) {
            var id = $("#hfBoxIds").val();
            var orderNo = $("#hfOrderNo").val();
            var code = $("#hfCustomerCode").val();
            var mobile = $("#hfTel").val();
            var address = $("#hfAddress").val();
            var language = $("#hfLanguage").val();//语言版本
            var qcaddress = $("#txtQcAddress").val();
            var receiveName = $("#hfReceiveName").val();

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

                var printData = [{
                    orderNo:orderNo, code:code, mobile:mobile,ReceiveName:receiveName, address:address, language:language, qcaddress:qcaddress,boxes:data
                }];
                var pageSize = {IntOrient:3,PageWidth:520,PageHeight:0,StrPageName:'CreateCustomPage'};
                PrintWithTemplate('outPrinterAB58GK',['CreateNormalFormPageByLodaByNew'],printData,print,pageSize);
            });
        }
        /**
         * 在用  自提小票打印
         * @param orderNo
         * @param code
         * @param picker
         * @param number
         */
        function loda_zi_ti_print(orderNo, code, picker, number) {
            var id = $("#hfBoxIds").val();

            $.get("../Ajax/GetBoxDetails.ashx", { id: id }, function (data) {
                printZiTi(orderNo, code, picker, number, data);
            });
            // var printData = [
            // { orderNo:orderNo, code:code, picker:picker, number:number }
            // ];
            // var pageSize = {IntOrient:3,PageWidth:520,PageHeight:0,StrPageName:'CreateCustomPage'};
            // PrintWithTemplate('outPrinterAB58GK',['PrintPickUpByCustomer'],printData,true,pageSize);
        }
        function printZiTi(orderNo, code, picker, number, data) {
            var printData = [
            { boxes:data, orderNo:orderNo, picker:picker, number:number }
            ];
            var pageSize = {IntOrient:3,PageWidth:520,PageHeight:0,StrPageName:'CreateCustomPage'};
            PrintWithTemplate('outPrinterAB58GK',['PrintPickUpByQc'],printData,true,pageSize);
        }

        function printReMin(id) {
              
            $.get("../Ajax/GetDeliveryExpressDetail.ashx", { id: id }, function (data) {
                var arr = eval(data);
                var boxes = eval(arr.Boxes);
                var box = boxes[0]; 
                // 转站配送
                var printData = [{
                    OrderNo: arr.OrderNo,
                    ReceName: arr.ReceName,
                    Mobile: arr.Mobile,
                    Address: arr.Address,
                    WareGroup: arr.WareGroup,
                    WareKhName: arr.WareKhName,
                    WareTel:arr.WareTel,
                    CustomerCode: arr.CustomerCode,
                    BoxSerialNo: box.BoxSerialNo,
                    Qty: arr.BoxCount,
                    Weight: box.Weight,
                    Size: box.Size
                }];

                var printTemplate = [];
                if(arr.ServiceTypeId === 1)
                {   // 转站
                    printTemplate.push('TransferDelivery');
                }
                else if(arr.ServiceTypeId === 2)
                {   // 转本土
                    printTemplate.push('TransferLocal');
                }
                else if(arr.ServiceTypeId === 3)
                {   // 第三方
                    printTemplate.push('TransferThirdParty');
                }

                if(arr.BoxCount > 1){
                    printTemplate.push('print_box_noes_2022');
                    printData.push({
                        code:arr.CustomerCode, mobile:arr.Mobile, boxes:boxes
                    });
                }
                if(printTemplate.length > 0){
                    var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
                    PrintWithTemplate('outPrinterGK888t',printTemplate,printData,true,pageSize);
                }
            });   
        }
        /*
         *在用热敏打印配送 一个箱子的配送单 100*60
         */
        function CreateDeliveryByCustomerNew(order_no, name, mobile, address, qcaddress, code, box, weight, size, storage) {
            var data = [{
                order_no:order_no, name:name, mobile:mobile, address:address, qcaddress:qcaddress, code:code, box:box, weight:weight, size:size, storage:storage
            }];
            var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
            PrintWithTemplate('outPrinterGK888t',['printDeliverSigleBox2021'],data,true,pageSize);
        };

        /**
         * 在用 配送条码 （多个箱子 ） 100*60
         * @param order_no
         * @param name
         * @param mobile
         * @param address
         * @param qcaddress
         * @param qty
         */
        function PrintPeiSong2021(order_no, name, mobile, address, qcaddress, qty, code, boxes) {
            var data = [{
                order_no:order_no, name:name, mobile:mobile, address:address, qcaddress:qcaddress, qty:qty
            },{
               code:code, mobile:mobile, boxes:boxes
            }];
            var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
            PrintWithTemplate('outPrinterGK888t',['print_orderno_no_2021','print_box_noes_2021'],data,true,pageSize);
        };

        function PrictZhuanOrder(order_no, cn_name,en_name) {
            var data = [{
                order_no:order_no, cn_name:cn_name,en_name:en_name
            }];
            var pageSize = {IntOrient:0,PageWidth:700,PageHeight:500,StrPageName:'A4'};
            PrintWithTemplate('outPrinterGK888t',['PrictZhuanOrderNew'],data,true,pageSize);
        }
    </script>
</asp:Content>