<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteMenu.Master" AutoEventWireup="true" CodeBehind="HistoryDelayDay.aspx.cs" Inherits="Crm25175.HistoryDelayDay" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../assets/css/jquery-ui-1.10.3.full.min.css" />

    <script type="text/javascript">
        //后台调用,区分提示信息底色
        //Danger,Info
        function ChangeMsgClass(MsgType) {
            if (MsgType == "Danger") 
            {
                DivMsg.className = 'alert alert-danger';
            }
            else 
            {
                DivMsg.className = 'alert alert-info';
            }
        }
    </script>
    <link rel="stylesheet" href="../assets/css/datepicker.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
		</script>
		<ul class="breadcrumb">
			<li>
				<i class="<%=PageIcon %>"></i>
                历史资料
			</li>
		</ul>
	</div>

    <div class="page-content">
        <div class="row col-xs-12">
            <div id="DivMsg" class="alert alert-info">
                <i class="icon-hand-right"></i>
                <asp:Label ID="LabMsg" runat="server" Text=" "></asp:Label>
			    <button class="close" data-dismiss="alert">
                <i class="icon-remove"></i>
                </button>
            </div>
        </div>

        <div class="page-header">
            <div class="col-xs-12 widget-box">
                <asp:Button ID="BtMenuTrans" runat="server"  Text="客户延期" CssClass="btn btn-primary btn-sm hidden" />
                <asp:Button ID="BtMenuTransAll" runat="server"  Text="延期所有" CssClass="btn btn-danger btn-sm hidden" />
                延期申请时间
                <span>
                    <asp:TextBox runat="server" ID="TxtDateStart" placeholder="延期开始" CssClass="input-small date-picker" data-date-format="yyyy-mm-dd"></asp:TextBox> ~
                </span>
                <span>
                    <asp:TextBox runat="server" ID="TxtDateEnd" placeholder="延期结束" CssClass="input-small date-picker" data-date-format="yyyy-mm-dd"></asp:TextBox>
                </span>
                <asp:Button ID="BtSearch" runat="server"  CssClass="btn btn-success btn-sm hidden" 
                    Text="查找" onclick="BtSearch_Click" />
				<span >
					<a href="#" data-action="reload"><i class="icon-search nav-search-icon green bigger-140" id="idsearch" title="查找"></i></a>
				</span>
                
            </div>
        </div>	

        <div id="dialog-submit" class="hide">
			<div class="alert alert-success bigger-110">
				取消勾选客户的延期申请，申请值为"N"的说明已经取消。
			</div>
			<div class="space-6"></div>
			<p class="bigger-110 bolder center grey">
				<i class="icon-hand-right blue bigger-120"></i>
				确定取消吗?
			</p>
		</div><!-- #dialog-confirm -->	

        <asp:Panel runat="server" Visible="false" ID="PanelOpen">
            <div class="row" id="DivAdd">
                
                    <div class="col-xs-4">
                        <div class="space-6"></div>
                        <div class="row">				    
				            <div class="profile-info-row">
					            <div class="profile-info-name">申请人员</div>
					            <div class="profile-info-value">
                                    <asp:Label ID="LabUserName" runat="server">
                                    </asp:Label>
                                    <asp:Label ID="LabCustomerTransID" runat="server" CssClass="hidden"/>
                                    <asp:Label ID="LabRowIndexID" runat="server" CssClass="hidden"/>
                                </div>
				            </div>
                        </div>
				    </div>
                    <div class="col-xs-4">
                        <div class="space-6"></div>
                        <div class="row">	
                            <div class="profile-info-row">
					            <div class="profile-info-name">申请时间</div>
					            <div class="profile-info-value">
						            <asp:Label ID="LabCreateDate" runat="server">
                                    </asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="space-6"></div>
                        <div class="row">	
                            <div class="profile-info-row">
					            <div class="profile-info-name">状态</div>
					            <div class="profile-info-value">
						            <asp:Label ID="LabCheckState" runat="server">
                                    </asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="space-2"></div>
                        <div class="row">	
                            <div class="profile-info-row">
					            <div class="profile-info-name">签核人员</div>
					            <div class="profile-info-value">
						            <asp:Label ID="LabChangeUser" runat="server">
                                    </asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="space-2"></div>
                        <div class="row">	
                            <div class="profile-info-row">
					            <div class="profile-info-name">更新时间</div>
					            <div class="profile-info-value">
						            <asp:Label ID="LabChangeDate" runat="server">
                                    </asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="space-2"></div>
                        <div class="row">	
                            <div class="profile-info-row">
					            <div class="profile-info-name">延期天数</div>
					            <div class="profile-info-value">
						            <asp:Label ID="LabDelayDays" runat="server">
                                    </asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>

                    <div class="col-xs-12">
                        <div class="row">				    
				            <div class="profile-info-row">
					            <div class="profile-info-name">延期说明</div>
					            <div class="profile-info-value">
                                    <asp:Label ID="LabCustomerTransName" runat="server" CssClass="col-xs-11"></asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>

                    <div class="col-xs-12">
                        <div class="row">				    
				            <div class="profile-info-row">
					            <div class="profile-info-name"><span class="text-danger">签核备注</span></div>
					            <div class="profile-info-value">
                                    <asp:Label ID="LabChangeRemark" runat="server" CssClass="col-xs-11"></asp:Label>
					            </div>
				            </div>
			            </div>
                    </div>

                    <div class="col-xs-12">
                        <div class="space-6"></div>
                        <asp:GridView ID="GridView2" runat="server" 
                            CssClass="table table-striped table-bordered table-hover" 
                            AutoGenerateColumns="False" DataKeyNames="ID" AllowPaging="False"
                            OnRowCommand="GridView1_RowCommand" 
                            onrowdatabound="GridView2_RowDataBound"  >
                            <Columns>
                                <asp:TemplateField HeaderText="选取">
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="CheckBoxTitle" runat="server" CssClass="ace"/>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckSelect" runat="server" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <%--<asp:BoundField DataField="CustomerID" HeaderText="客户ID" ReadOnly="True"> 
                                <HeaderStyle CssClass="hidden" />
                                <ItemStyle CssClass="hidden" />
                                </asp:BoundField> --%>
                                <asp:BoundField DataField="CustName" HeaderText="客户" ReadOnly="True"/> 
                                <asp:BoundField DataField="FromName" HeaderText="来源" ReadOnly="True"/> 
                                <asp:BoundField DataField="TypeName" HeaderText="类型" ReadOnly="True"/> 
                                <asp:BoundField DataField="ProductName" HeaderText="意向产品" ReadOnly="True"/> 
                                <asp:BoundField DataField="State" HeaderText="申请" ReadOnly="True"/> 
                                <asp:TemplateField HeaderText="查看">
                                    <ItemTemplate>
                                        <asp:Button class=" btn btn-xs btn-success smaller-80 " Text="View" id="ButtonView" runat="server" CommandName="ViewUI" CommandArgument='<%# Bind("CustomerID")%>'>
										</asp:Button>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </div>

				    <div class="form-group col-xs-12 center">
                        <div class="space-6"></div>
                        <div class="col-xs-3">
                        </div>
                        <div class="col-xs-3">
                        <asp:Panel runat="server" Visible="true" ID="PanelApply">
                            <asp:Button ID="BT_UnApply" runat="server" Text="取消延期客户" class="icon-ok" OnClick="BT_UnApply_Click"
                                    CssClass="btn btn-danger icon-ok btn-sm hidden"  />
                            <button class="btn btn-danger bigger-110" type="button" id="BtUnApply">
						        <i class="icon-ok"></i>
						        取消延期客户
					        </button>
                        </asp:Panel>
                        </div>
                        <div class="col-xs-3">
                        <Button id="Button2" type="reset" value="返回"  class="btn" onclick="javascript:history.go(-1)"><i class="icon-backward bigger-110"></i>
					        Back
                        </Button>
                        </div>
                        <div class="col-xs-3">
                        </div>
                    </div>
                
                
                
            </div>
        </asp:Panel>

        <asp:Panel runat="server" Visible="false" ID="PanelData">
            <div class="row">
	            <div class="col-xs-12">
		            <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" 
                            CssClass="table table-striped table-bordered table-hover" 
                            AutoGenerateColumns="False" DataKeyNames="DelayDayID" AllowPaging="True" 
                            OnPageIndexChanging="GridView1_PageIndexChanging" 
                            OnRowCommand="GridView1_RowCommand" >
                            <Columns>
                                <asp:BoundField DataField="UserName" HeaderText="申请人" ReadOnly="True"/> 
                                <asp:BoundField DataField="CreateDate" HeaderText="申请时间" ReadOnly="True"/>
                                <asp:BoundField DataField="CheckState" HeaderText="状态" ReadOnly="True"/> 
                                <asp:BoundField DataField="ChangeDate" HeaderText="签核时间" ReadOnly="True"/> 
                                <asp:TemplateField HeaderText="延期说明">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TxtCustomerTransName" runat="server" TextMode="MultiLine" Text='<%# Bind("DelayDayName") %>' CssClass="col-xs-12" Enabled="false"></asp:TextBox>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="col-xs-3" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="签核备注">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TxtChangeRemark_list" runat="server" TextMode="MultiLine" Text='<%# Bind("ChangeRemark") %>' CssClass="col-xs-12" Enabled="false"></asp:TextBox>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="col-xs-2" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="DelayDays" HeaderText="天数" ReadOnly="True"/> 
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:Button class=" btn btn-xs btn-success smaller-80 " Text="Open" id="ButtonOpen" runat="server" CommandName="OpenUI" CommandArgument='<%# Bind("DelayDayID")%>'>
										</asp:Button>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerSettings Mode="NumericFirstLast" />
                            <HeaderStyle Wrap="False" />
                            <RowStyle Wrap="False" />
                        </asp:GridView>
		            </div><!-- /.table-responsive -->
	            </div><!-- /span -->
            </div>
        </asp:Panel>
    </div>
    
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_Footer" runat="server">

    <script type="text/javascript" src="../assets/js/jquery-2.0.3.min.js"></script>

	<script type="text/javascript">
		window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
	</script>

	<script type="text/javascript">
		if ("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
	</script>
	<script type="text/javascript" src="../assets/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../assets/js/typeahead-bs2.min.js"></script>

	<!-- page specific plugin scripts -->
    <!--插件bootstrap-datepicker.min.js必须在jquery-ui-1.10.3.full.min.js之后,否则日期格式、年的选中等会部分失效-->
    <script type="text/javascript" src="../assets/js/jquery-ui-1.10.3.full.min.js"></script>
    <script type="text/javascript" src="../assets/js/date-time/bootstrap-datepicker.min.js"></script>
	<script type="text/javascript" src="../assets/js/jquery.ui.touch-punch.min.js"></script>
	<!-- ace scripts -->

	<script type="text/javascript" src="../assets/js/ace-elements.min.js"></script>
	<script type="text/javascript" src="../assets/js/ace.min.js"></script>
    <script type="text/javascript" src="../assets/js/bootbox.min_25175.js"></script>

    <script type="text/javascript">

        jQuery(function ($) {
            //全选确认框
            $('table th input:checkbox').on('click', function () {
                var that = this;
                $(this).closest('table').find('tr > td:first-child input:checkbox')
	            .each(function () {
	                this.checked = that.checked;
	                $(this).closest('tr').toggleClass('selected');
	            });
            });

            //日期
            $('.date-picker').datepicker({ autoclose: true }).next().on(ace.click_event, function () {
                $(this).prev().focus();
            });

            //查询
            $("#idsearch").on('click', function (e) {
                document.getElementById('<%=BtSearch.ClientID %>').click();
            });

            //对话框全局
            $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
                _title: function (title) {
                    var $title = this.options.title || '&nbsp;'
                    if (("title_html" in this.options) && this.options.title_html == true)
                        title.html($title);
                    else title.text($title);
                }
            }));

            //取消延期
            $("#BtUnApply").on('click', function (e) {
                e.preventDefault();
                $("#dialog-submit").removeClass('hide').dialog(
                {
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'><i class='icon-ok red'> 取消延期</i></h4></div>",
                    title_html: true,
                    buttons: [
						{
						    html: "<i class='icon-ok bigger-110'></i>&nbsp; 确定",
						    "class": "btn btn-success btn-xs",
						    click: function () {
						        document.getElementById('<%=BT_UnApply.ClientID %>').click();
						    }
						}
						,
						{
						    html: "<i class='icon-remove bigger-110'></i>&nbsp; 取消",
						    "class": "btn btn-xs",
						    click: function () {
						        $(this).dialog("close");
						    }
						}]
                });
            });
        });
    </script>
    

</asp:Content>
