<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpportunityView.aspx.cs"
    Inherits="OAWeb.crm.opportunity.OpportunityView" Title="" MasterPageFile="~/Dialog/DialogMaster.Master"
    Theme="Default" EnableViewState="true" %>

<%@ Register Src="/UserControls/ActionList.ascx" TagName="ActionList" TagPrefix="uc2" %>
<%@ Register Src="/UserControls/LogList.ascx" TagName="LogList" TagPrefix="uc5" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .right
        {
            width: 100px;
            color: #000000;
        }
        .table_list th
        {
            padding: 0px;
        }
        .order_product td
        {
            background-color: #fff;
            padding: 4px;
        }
        .CustomerTop
        {
            width: 100%;
        }
        .CustomerTop td
        {
            padding: 10px;
        }
        .CustomerTop td a
        {
            margin-left: 15px;
        }
        .TopTb .right
        {
            width: 70px;
        }
        .st12pt
        {
            padding: 3px;
            padding-right: 10px;
        }
        .header_op,.header_nav
        {
        	display:none;
        }
        
        body
        {
            background-color: #ededed;
        }
        .tab_handles
        {
            
        }
        .tabs .tab_handles 
        {
           
        }
        .tabs .tab_handles span
        {
            border-color: #CCCCCC;
            border-style: solid solid solid;
            border-width: 1px 1px 1px;
            background-color: #EEEEEE;
            padding:5px;
            padding-left:10px;
            padding-right:10px;
        }
    </style>
    <!--主体左侧-->
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0" style="margin: auto;
        width: 80%;">
        <tr>
            <td class="main_center">
                <div class="page_content tabs">
                    <div class="order_widget tab_contents" style="margin-bottom: 0px;">
                        <div class="order_State">
                            <table class="CustomerTop">
                                <tr>
                                    <td style="padding-left: 28px;">
                                        <strong class="fonts " style="font-size: 25px;">商机：<asp:Label ID="txtTopic" runat="server"
                                            Text="商机：深刻地方二哥"></asp:Label>
                                        </strong><a href="javascript:void(0)"  id="LinkEdit" runat="server">编辑商机</a>
                                    </td>
                                    <td style="text-align: right">
                                        <a href="javascript:void(0)" runat="server" id="LinkAction">创建活动记录</a> <a href="#">创建订单</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                         <div class="tab_handles" style="margin-left: 25px; background: none; border-top: none;
                            height: 35px;">
                                <span class="current">详细信息</span>  <span>操作日志</span>
                            </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td class="main_center">
                <!--主体-->
                <div class="page_main">
                    <div class="page_content">
                        <div class="tabs">
                       
                            <div class="tab_contents" style="border-top: none">
                                <table width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <div class="tab_content ">
                                                <div class="order_widget">
                                                    <div class="order_State">
                                                        <strong class="fonts ">基本信息</strong>
                                                        <table style="width: 100%; border-collapse: collapse" class="TableBorder" border="1"
                                                            cellspacing="0" bordercolor="#e6e6e6" cellpadding="3">
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    机会名称
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblTopic" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    负责人
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblTrackUser" runat="server"></asp:Label>
                                                                    <asp:LinkButton ID="lbtnTrackUser" runat="server" Visible="false" OnClick="lbtnTrackUser_Click">/我要领用</asp:LinkButton>
                                                                    [<asp:LinkButton ID="lbtnChange" runat="server" Enabled="false" OnClick="lbtnChange_Click">更改</asp:LinkButton>
                                                                    ]<asp:DropDownList ID="ddlEmployee" runat="server" Visible="false">
                                                                    </asp:DropDownList>
                                                                    <asp:Button ID="btnSureChange" runat="server" Text="√" Visible="false" OnClick="btnSureChange_Click"
                                                                        Width="30px" />
                                                                    <asp:Button ID="btnCancel" runat="server" Text="X" OnClick="btnCancel_Click" Visible="false"
                                                                        Width="30px" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    机会编号
                                                                </td>
                                                                <td align="left" width="35%">
                                                                    <asp:Label ID="lblOpportunityCode" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    关注产品
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblProduct" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    客户名称
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:LinkButton ID="lbtnCustomer" runat="server"></asp:LinkButton>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    联系人
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:LinkButton ID="lbtnContact" runat="server"></asp:LinkButton>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    预约签约日期
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblExpectDate" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    类别
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblBizTypeID" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    预计金额
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblExpectMoney" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    可能性
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblProbability" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    重要程度
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblHotLevel" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    机会阶段
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblPhaseID" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    来源线索
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:HyperLink ID="hyplnkCustomerClue" runat="server"></asp:HyperLink>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    结果
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblState" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    失败原因
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblReason" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    描述
                                                                </td>
                                                                <td class="st12pt" align="left" width="85%" colspan="3">
                                                                    <asp:Label ID="lblRemark" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="left" width="100%" colspan="4">
                                                                    <b>系统信息</b>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    创建人
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblCreateDate" runat="server" Text=""></asp:Label>
                                                                    <asp:Label ID="lblCreateUser" runat="server" Text=""></asp:Label>
                                                                </td>
                                                                <td class="st12pt" align="right" width="15%" bgcolor="#F0F0F0">
                                                                    上次修改人
                                                                </td>
                                                                <td class="st12pt" align="left" width="35%">
                                                                    <asp:Label ID="lblModifyDate" runat="server" Text=""></asp:Label>
                                                                    <asp:Label ID="lblModifyMan" runat="server" Text=""></asp:Label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </div>

                                                <div class="order_widget">
                                                <strong class="fonts ">商机跟进</strong>
                                                    <asp:GridView ID="gvAction" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                                                        >
                                                        <HeaderStyle CssClass="title" Wrap="False" />
                                                        <Columns>
                                                            
                                                            <asp:BoundField DataField="CreateDate" HeaderText="时间" >
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                            </asp:BoundField>
                                                            <asp:TemplateField HeaderText="操作人">
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemTemplate>
                                                                    <%# OACore.Caches.UsersCache.Instance.GetNickName(ObjToInt( Eval("UserId"))) %>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="PhaseName" HeaderText="阶段">
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                            </asp:BoundField>
                                                            <asp:TemplateField HeaderText="可能性" >
                                                                <ItemTemplate>
                                                                    <%# Eval("Probability")%> %
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="金额" >
                                                                <ItemTemplate>
                                                                    <%# Eval("ExpectMoney")%> 
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                    <div class="pager-bar">
                                                        <webdiyer:aspnetpager id="plAction" runat="server" alwaysshow="True" direction="LeftToRight"
                                                            firstpagetext="[首页]" horizontalalign="Right" lastpagetext="[末页]" nextpagetext="[下一页]"
                                                            prevpagetext="[上一页]" showcustominfosection="Left" width="100%" pagesize="10"
                                                            onpagechanged="plAction_PageChanged"></webdiyer:aspnetpager>
                                                    </div>
                                                </div>
                                            

                                           
                                                <div class="order_widget">
                                                    <div class="order_State">
                                                        <strong class="fonts ">活动记录</strong>
                                                         <uc2:ActionList ID="ActionList1" runat="server" />
                                                    </div>
                                                </div>

                                            </div>
                                            
                                                
                                            

                                            <div class="tab_content hide">
                                                <div class="order_widget">
                                                 <uc5:LogList ID="LogList1" runat="server" />
                                                </div>
                                            </div>

                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>

    <asp:HiddenField ID="TabId" runat="server" Value="0"  />
    <script type="text/javascript">

        $(".tab_handles span").click(function () {
            var hideIndex = $(".tab_handles .current").index();
            $(".tab_handles span").removeClass("current");
            $(this).addClass("current");
            $(".tab_contents .tab_content:eq(" + hideIndex + ")").hide();
            $(".tab_contents .tab_content:eq(" + $(this).index() + ")").show();

            $("#<%=TabId.ClientID  %>").val($(this).index());

        })

        var CurrentIndex = $("#<%=TabId.ClientID  %>").val();
        $(".tab_handles span:eq(" + CurrentIndex + ")").click();
        
    </script>

</asp:Content>
