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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/jquery-3.3.1.min.js"></script>
    <link href="../Scripts/bootstrap_3.3.7_css_bootstrap.min[1].css" rel="stylesheet" />
    <link href="../Scripts/bootstrap-select.min.css" rel="stylesheet" />

    <script src="../Scripts/bootstrap_3.3.7_js_bootstrap.min.js"></script>
    <script src="../Scripts/bootstrap-select.min.js"></script>   
    <script src="../Scripts/jquery-1.6.3.js"></script>
    <script src="../Scripts/jqueryUI/ui/jquery-ui-1.8.24.custom.js"></script>

    <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>

    <style>
        .hid {
            display: none !important;
        }

        .info input[type=file] {
            display: none;
        }
    </style>

    <script type="text/javascript">
        function Select(a) {
            $(a).next().click();
            $(a).next().removeClass("hid");
        }

        function viewPIc(a) {
            var imgUrl = $(a).attr("imgUrl");
            var str = 'ViewPic.aspx?imgUrl=' + imgUrl;
            layer.open({
                type: 2,
                title: false,
                closeBtn: 1, //不显示关闭按钮
                shade: [0],
                area: ['800px', '800px'],
                content: [str] //iframe的url，no代表不显示滚动条

            });

            return false;
        }

        // 使用checkbox当做全选反选
        function check_all_not() {
            var check = $("#checkboxAll").prop("checked");
            if (check === true) {
                checkAll();
            }
            else {
                checkReverse();
            }
        }

        // 正选
        function checkAll() {
            $(".check").each(function () {
                if (!$(this).prop("checked")) {
                    $(this).prop("checked", true);
                }
            });
        }

        // 反选
        function checkReverse() {            
             $(".check").each(function () {
                if ($(this).prop("checked")) {
                    $(this).prop("checked", !$(this).prop("checked"));
                }
            });
        }
        
        // 物流件明细列表
        function ShowDetail(url) {
            $("#EditIframe").attr("src", url);
            $("#iframeEdit").dialog({
                autoOpen: true,
                resizable: false,
                width: 800,
                height: 600,
                modal: true,
                title: "物流件明细列表",
                buttons: {
                    "确认": function () {
                        $(this).dialog("close");
                    },
                    "取消": function () {
                        $(this).dialog("close");
                    }
                },
            });
            return false;
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <yee:PageTitle ID="ptTitle" runat="server">
        <ShortCuts>
            <a href="TransferLoadCarList.aspx" title="返回中转列表">返回中转列表</a>
        </ShortCuts>
    </yee:PageTitle>
    <div>
        <asp:Button ID="btnLoadCarScan" runat="server"  OnClick="btnLoadCar_Click" style="width:1px;border:none"  />
        <asp:Button ID="btnPrintXiaoPiao" runat="server" CssClass="button" OnClick="btnPrintTicket_Click" />
        <asp:Button ID="btnPrintXiaoPiaoPreview" runat="server" CssClass="button" OnClick="btnPrintTicketPreview_Click" />
        <asp:Button ID="btnPrintDetails" runat="server" CssClass="button" OnClick="btnPrintDetails_Click" />
        <asp:Button ID="btnPayment" runat="server" CssClass="button" OnClick="btnPayment_Click" />
    </div>
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>
    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0" class="table">
            <tr>
                <td class="tbpostheader">
                    <%=GetText("仓库") %>
                </td>
                <td class="tbpost">
                 <%--   <yee:UserWarehousesDropDownList runat="server" WarehouseType="海外仓储" ID="ddlWare" data-live-search="true" CssClass="selectpicker"></yee:UserWarehousesDropDownList>--%>
                    <asp:DropDownList runat="server" ID="ddlStorageId" ></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("目标仓") %>
                </td>
                <td class="tbpost">
                    <asp:DropDownList ID="ddlTargetWare" runat="server" data-live-search="true" CssClass="selectpicker" OnSelectedIndexChanged="ddlTargetWare_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                </td>
            </tr> 
            <tr>
                <td class="tbpostheader">
                    <%=GetText("集包/箱子号/配送单/自提单/本土件") %>
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtOrderNo" runat="server" Font-Size="XX-Large"></asp:TextBox>
                    <asp:Button ID="btnLoadCar" runat="server" CssClass="button" OnClick="btnLoadCar_Click" Text="扫描" />
                </td>
            </tr>
            <tr>
                <td class="tbpostheader">
                    <%=GetText("备注") %>
                </td>
                <td class="tbpost">
                    <asp:TextBox ID="txtRemark" runat="server" Enabled="false" TextMode="MultiLine" Width="350px" Height="50px" ></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <div style = "margin-top: 10px;">
     <!--   <asp:Button ID="btnPiAdd" runat="server" Text="执行和包操作" CssClass="button" OnClientClick="return confirm('是否要对勾选数据进行和包操作？')"  OnClick="btnBatchAdd_Click" />-->
    </div>

    <div>
    <asp:Repeater ID="rptCollect" runat="server" OnItemDataBound="rptCollect_ItemDataBound" OnItemCommand="rptCollect_ItemCommand">
        <HeaderTemplate>
            <table cellpadding="0" class="table" cellspacing="0" border="0">
                <tr>
                    <td class="tbheader" width="30px">
                        <input type="checkbox" id="checkboxAll" class="checkboxAll" onclick="check_all_not()" />
                    </td>
                    <td class="tbheader">
                        <%=GetText("序号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("业务类型") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("是否付款") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("和包号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("流水号") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("目标仓") %>
                    </td>
                     <td class="tbheader">
                        <%=GetText("签收信息") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("装车信息") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("发货确认信息") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("E仓签收信息") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("凭证") %>
                    </td>
                    <td class="tbheader">
                        <%=GetText("操作") %>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tbrow">
                <td class="tbpost">
                    <input type="checkbox" id="cbItem" runat="server" class="check" />
                    <asp:HiddenField ID="hfId" runat="server" Value='<%#Eval("UniqueId") %>' />
                    <asp:HiddenField ID="hfTypeId" runat="server" Value='<%#Eval("TypeId") %>' />
                    <asp:HiddenField ID="hfCollectSerialNo" runat="server" Value='<%#Eval("CollectSerialNo") %>' />
                </td>
                <td class="tbpost">
                    <%#Eval("number") %>
                </td>
                <td class="tbpost">
                    <%#Eval("Type") %>
                </td>  
                <td class="tbpost">
                    <asp:LinkButton ID="lbnPaymentStatus" runat="server"></asp:LinkButton> 
                </td> 
                <td class="tbpost">
                    <%#Eval("MergeNO") %>
                </td>  
                <td class="tbpost">
                    <asp:HyperLink ID="hlSerialNo" runat="server"></asp:HyperLink>
                    <asp:LinkButton ID="lbnShowDetail" runat="server" CommandArgument='<%#Eval("CollectSerialNo") %>' CommandName="ShowDetail"></asp:LinkButton> 
                </td>
                <td class="tbpost">
                    <%#Eval("TargetWarehouseName") %>
                </td>
                <td class="tbpost">
                    <%#Eval("SignInByName") %> </br> <%#Eval("SignInOn") %>
                </td>   
                <td class="tbpost">
                    <%#Eval("CreatedByName") %> </br> <%#Eval("CreatedOn") %>
                </td>
                <td class="tbpost">
                    <%#Eval("TransferSignByName") %> </br><%#Eval("TransferSignOn") %>
                </td> 
                <td class="tbpost">
                    <%#Eval("ESignByName") %> </br><%#Eval("ESignOn") %>
                </td>
                <td class="tbpost">
                    <a href="javascript:void(0)" onclick=" Select(this)">选择图片</a>
                    <asp:FileUpload ID="filePic" runat="server" CssClass="hid" />
                    <asp:LinkButton ID="lbnUpload" runat="server" Text="上传" CommandArgument='<%#Eval("UniqueId") %>' CommandName="upload"></asp:LinkButton>
                    <asp:LinkButton ID="lbnView" runat="server" Text="凭证" OnClientClick="return viewPIc(this)" imgUrl='<%#Eval("ImgUrl") %>'></asp:LinkButton>
                </td>
                <td class="tbpost">
                   <!-- <asp:LinkButton ID="lbnRemove" runat="server" OnClientClick = "return confirm('确定删除吗？')" CommandArgument='<%#Eval("UniqueId") %>' CommandName="remove" Text="移除"></asp:LinkButton> -->
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandArgument='<%#Eval("CollectUniqueId") %>' CommandName="detail" Text="和包详情"></asp:LinkButton>
                    <asp:LinkButton ID="lbnPrintMergeInfo" runat="server" CommandArgument='<%#Eval("UniqueId") %>' CommandName="printMergeInfo" Text="标签打印"></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>

        <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>


</div>
    <asp:Repeater ID="rptLink" runat="server">
        <ItemTemplate>
            <asp:HyperLink ID="hfExcel" runat="server" NavigateUrl='<%#Eval("ImgUrl") %>'>凭证下载</asp:HyperLink>
        </ItemTemplate>
    </asp:Repeater>
    <asp:HiddenField ID="hfRecordId" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hfDate" runat="server" ClientIDMode="Static" />
    <div id="iframeEdit" class="iframeEdit" style ="display:none">
        <iframe id="EditIframe" frameborder="0" class="EditIframe" style="width: 100%; min-height: 0px; height: 480px;"></iframe>
    </div>
        
    <script language="javascript" type="text/javascript">

        // 中转打印
        function PrintZhuan(serialNo, cardNo, stockOutOn, warehouse, coCount, reCount, boxCount, pickCount, totalCount, volCount,weight,volume,typeId) {
            
            var size = "";
            if (typeId = "1") { size="发货" }

            var printData = [{
                SerialNo:serialNo,
                CardNo:cardNo,
                StockOutOn:stockOutOn,
                Warehouse:warehouse,
                CoCount:coCount,
                ReCount:reCount,
                BoxCount:boxCount,
                PickCount:pickCount,
                TotalCount:totalCount,
                VolCount:volCount,
                Weight:weight,
                Volume:volume,
                Size:size
            }];

            var pageSize = {IntOrient:0,PageWidth:520,PageHeight:0,StrPageName:'CreateCustomPage'};
            PrintWithTemplate('outPrinterAB58GK',['PrintZhuanDetail'],printData,true,pageSize);
        };
       // 小票打印
       function PrintTicket(serialNo, Code, heBaoCount, StockOutOn, WareHouseName, CoCount, ReCount, boxCount, PickCount, benTuCount, benTuDuoCount,TotalWeight,TotalVolume, kongYunCount,IsPreview,WarehouseEnName,opName) {
            
            var printData = [{
                StockOutOn:StockOutOn,
                WareHouseName:WareHouseName,
                CoCount:CoCount,
                HeBaoCount:heBaoCount,
                ReCount:ReCount,
                BenTuCount:benTuCount,
                BenTuDuoCount:benTuDuoCount,
                PickCount:PickCount,
                BoxCount:boxCount,
                SerialNo:serialNo,
                Code:Code,
                KongYunCount:kongYunCount,
                TotalWeight:TotalWeight,
                TotalVolume:TotalVolume,
                OpName:opName,
                WarehouseEnName:WarehouseEnName
            }];

            var pageSize = {IntOrient:0,PageWidth:520,PageHeight:0,StrPageName:'CreateCustomPage'};
            PrintWithTemplate('outPrinterAB58GK',['PrintTicket'],printData,IsPreview,pageSize);

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