Skip to content
CheckOrder.aspx 11.8 KiB
Newer Older
Jack Dan's avatar
Jack Dan committed
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckOrder.aspx.cs" Inherits="CheckOrder" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Css/reset.css" rel="stylesheet" type="text/css" />
    <link href="Css/normal.css" rel="stylesheet" type="text/css" />
    <link href="plugin/colorbox/style1/colorbox.css" rel="stylesheet" type="text/css" />
    <link href="plugin/jQueryUI/css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet"
        type="text/css" />
    <script src="Scripts/jquery-1.5.2.js" type="text/javascript"></script>
    <script src="Scripts/kenanfans.common.js" type="text/javascript"></script>
    <script src="plugin/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <script src="plugin/jQueryUI/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
    <script src="plugin/jQueryUI/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var $liDetail, $loadingPnl;
        jQuery(function () {



            $("#lstSupplier").bind("change", function () {
                LoadList();
                LoadList1();
            });

            $("#datePicker").datepicker({
                altField: '#actualDate',
                altFormat: 'yy-mm-dd',
                defaultDate: $("#hfInitDate").val(),
                onSelect: function (dateText, inst) { LoadList(); LoadList1(); }
            });
            $liDetail = $("#liDetail");
            $loadingPnl = $("#loadingPnl");
            $loadingPnl.hide();
            $liDetail.hide();
            LoadList();
            LoadList1();


        });


        function LoadList() {
            var dateStr = $("#datePicker").val().replace(/-/g, '');

            var loadUrl = "AjaxPages/AjaxCheckOrder.ashx?rnd=" + Math.random();

            $loadingPnl.hide();
            $liDetail.hide();

            $(".topLine").before($liDetail);

            $("#listDiv li").remove();

            $("#listDiv").attr("disabled", "true");

            $.post(loadUrl, { Action: "GetOrderStatusList", DateStr: dateStr, SupplierID: $("#lstSupplier").val() }, function (data) {
                OnLoadSuccess(data);
            }, "html");

        }

        function LoadList1() {


            var dateStr = $("#actualDate").val().replace(/-/g, '');
            var loadUrl = "AjaxPages/AjaxCheckOrder.ashx?rnd=" + Math.random();

            $.ajax({
                type: "POST",
                url: loadUrl,
                dataType: "json",
                data: {
                    Action: "JieGuo",
                    DateStr: dateStr,
                    SupplierID: $("#lstSupplier").val()


                },

                success: function (data) {

                    $("#Label1").html(data.JG);

                }

            });
        }

        function OnLoadSuccess(data) {
            $("#listDiv ul").append(data);

            $("#listDiv").removeAttr("disabled");

            $(".viewList").bind("click", function () {
                $liDetail.hide();
                $(this).parents("li").after($liDetail);
                $liDetail.fadeIn("normal");
                $loadingPnl.show();

                $("#checkListDiv").empty();

                var loadUrl = $(this).attr("href") + "&rnd=" + Math.random();
                $.post(loadUrl, { Action: "GetCheckOrderList" }, function (data) {
                    OnLoadCOSuccess(data);
                }, "html");

                return false;
            });

            $(".newCheck").colorbox({
                iframe: true,
                opacity: 0,
                transition: "none",
                title: function () { return $(this).text() },
                innerHeight: '80%',
                innerWidth: 540,
                overlayClose: false,
                onClosed: OnColorBoxClose
            });
            $(".newPingJia").colorbox({
                iframe: true,
                opacity: 0,
                transition: "none",
                title: function () { return $(this).text() },
                innerHeight: '85%',
                innerWidth: 820,
                overlayClose: false,
                onClosed: OnColorBoxClose
            });
        }

        function OnLoadCOSuccess(data) {
            $loadingPnl.hide();
            $("#checkListDiv").append(data);

            $(".viewDetail").colorbox({
                iframe: true,
                opacity: 0,
                transition: "none",
                title: function () { return $(this).val() },
                innerHeight: '80%',
                innerWidth: 540,
                overlayClose: false,
                current: ""
            });
        }

        function UpdateStauts(type, orderid, supplierid) {
            if (confirm("确认要验收完毕吗?")) {
                var loadUrl = "AjaxPages/AjaxCheckOrder.ashx?rnd=" + Math.random();
                $.post(loadUrl, { Action: "UpdateStatus", Type: type, OrderID: orderid, SupplierID: supplierid }, function (data) {
                    AjaxHandlerCallback(data);
                }, "json");
            }
            return false;
        }

         function BuZheng(type, orderid, supplierid) {
            if (confirm("确认要补正领料吗?")) {
                var loadUrl = "AjaxPages/AjaxCheckOrder.ashx?rnd=" + Math.random();
                $.post(loadUrl, { Action: "BuZheng", Type: type, OrderID: orderid, SupplierID: supplierid }, function (data) {
                    AjaxHandlerCallback(data);
                }, "json");
            }
            return false;
        }


        function AjaxHandlerCallback(data) {
            if (data.Action == "UpdateStatus") {

                if (data.status == "success") {
                    alert(data.msg);
                    LoadList();
                    LoadList1();

                }
                else {
                    alert(data.msg);
                }

            }
        }

        function hz(Userdel, SupplierID, dateStr, OrderID) {

            $.get("AjaxPages/GetSelectPJ.ashx", { OrderID: OrderID, random: Math.random() },
                        function (txt) {
                            if (txt == "Y") {
                                alert('未评价不能新增验收');
                                $.colorbox.close();                               
                            }
                            else {
                               
                                $.colorbox({
                                    iframe: true,
                                    opacity: 0,
                                    transition: "none",
                                    title: function () { return $(this).text() },
                                    innerHeight: '80%',
                                    innerWidth: 540,
                                    overlayClose: false,
                                    onClosed: OnColorBoxClose,
                                    href: 'CheckOrderNew2.aspx?DeliveryID=' + Userdel + '&SupplierID=' + SupplierID + '&CreateDate=' + dateStr + '&OrderID=' + OrderID
                                });
                            }
                        }
                    );
        }
        function Fhz(OrderID, SupplierID) {
            
            $.get("AjaxPages/GetSelectPJ.ashx", { OrderID: OrderID, random: Math.random() },
                        function (txt) {
                            if (txt == "Y") {
                                alert('未评价不能新增验收');
                                $.colorbox.close();

                            }
                            else {
                                
                                $.colorbox({
                                    iframe: true,
                                    opacity: 0,
                                    transition: "none",
                                    title: function () { return $(this).text() },
                                    innerHeight: '80%',
                                    innerWidth: 540,
                                    overlayClose: false,
                                    onClosed: OnColorBoxClose,
                                    href: 'CheckOrderNew.aspx?SupplierID=' + SupplierID + '&OrderID=' + OrderID
                                });
                            }
                        }
                    );
        }
    </script>
    <style type="text/css">
        /*
    .detail { border:0px solid #FFF !important; background-color:White !important; padding:0px !important; margin:0px !important;}
    */
        #liDetail
        {
            zoom: 1;
            clear: both;
            height: 1%;
        }
        .boxTop
        {
            position: absolute;
            width: 25px;
            height: 12px;
            margin-top: -20px;
            margin-left: 480px;
            background-image: url(images/sprite.png);
            background-position: -833px -33px;
        }
        #loadingPnl
        {
            padding: 3px;
            height: 1%;
        }
        #loadingPnl span
        {
            line-height: 22px;
            height: 22px;
            color: #4b77b8;
            display: block;
            float: left;
        }
        .boxMain
        {
            display: block;
        }
        .detailRow
        {
            border-bottom: 1px dotted #333;
            line-height: 24px;
            height: 24px;
        }
        .alBox01 a
        {
            margin-left: 0px;
        }
    </style>
</head>
<body id="CheckOrder">
    <form id="form1" runat="server">
    <asp:HiddenField ID="hfInitDate" runat="server" />
    <asp:HiddenField ID="HiddenField1" runat="server" />
    <ul id="liDetailContainer" style="display: none;">
        <li id="liDetail" style="border: 1px solid #AAA; background-color: White; margin-top: 12px;">
            <div class="boxTop">
            </div>
            <div class="boxMain">
                <div id="loadingPnl">
                    <span>
                        <img src="Images/Loading.gif" /></span> <span style="padding-left: 15px;">正在加载。。。</span>
                    <br class="clear" />
                </div>
                <div id="checkListDiv">
                </div>
            </div>
        </li>
    </ul>
    <div class="topLine">
        &nbsp;</div>
    <div class="mainDiv">
        <div class="left260">
            <font style="color: red; font-size: large;">订单验收日期</font>
            <div id="datePicker">
            </div>
        </div>
        <div class="right690">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td style="width: 200px">
                        <input type="text" id="actualDate" runat="server" readonly="readonly" />
                    </td>
                    <td style="width: 490px; text-align: right">
                        <b>供应商:</b>
                        <asp:DropDownList ID="lstSupplier" runat="server" Width="150px">
                        </asp:DropDownList>
                        &nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="color: Red;">
                            <asp:Label ID="Label1" runat="server"></asp:Label></font>
                    </td>
                </tr>
            </table>
            <div id="listDiv">
                <ul id="listBox" class="alBox01">
                    <li></li>
                </ul>
            </div>
            
        </div>
        <br class="clear" />
    </div>
    </form>
</body>
</html>