<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpportunityEdit.aspx.cs"
    Inherits="OAWeb.crm.opportunity.OpportunityEdit" EnableViewState="true" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="/UserControls/UcActionList.ascx" TagName="UcActionList" TagPrefix="uc1" %>
<!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" id="Head1">
    <title>编辑活动记录</title>
    <link href="../../Css/global.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
    <script src="/js/artDialog/artDialog.js?skin=default" type="text/javascript"></script>
    <script src="/js/artDialog/plugins/iframeTools.source.js" type="text/javascript"></script>
    <link href="/App_Themes/Default/default.css" rel="stylesheet" type="text/css" />
    <script src="/Js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Js/common.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        function Open_Modal_Window() {
            var Url = "/Dialog/CustomerDialog.aspx";
            OpenRadioDialog(Url, '选择客户', CallbackFunUser);

            return false;
        }

        function CallbackFunUser(text, value) {
            $('#<%=txtCustomerName.ClientID %>').val(text);
            $('#<%=txtCustomerID.ClientID %>').val(value);

        }


        /*打开线索窗口*/

        function OpenClueDialog() {
            var Url = "/Dialog/CustomerClueSelectDialog.aspx";
            OpenRadioDialog(Url, '选择线索', CallbackFun);

            return false;
        }

        function CallbackFun(text, value) {
            $('#<%=txtCustomerClueName.ClientID %>').val(text);
            $('#<%=hidfldCustomerClueId.ClientID %>').val(value);

        }
    </script>
    <style type="text/css">
        .tb
        {
            background-color: #E1E1E1;
            border: 0 none;
            border-collapse: separate;
            border-spacing: 1px;
            width: 100%;
        }
        
        .TableBorder
        {
            padding: 10px;
        }
        
        .st12pt
        {
            padding: 5px;
        }
        
        .TableBorder td
        {
            padding: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 700px; height: 500px; overflow-y: scroll; margin-left: 10px;">
        <table align="center" class="TableBorder" bordercolor="#e6e6e6" cellspacing="0" cellpadding="3"
            border="1" style="border-collapse: collapse; width: 644px;">
            <tr class="AlterColor">
                <td align="right" colspan="4" bgcolor="#e6e6e6" style="height: 25px">
                    <p align="center">
                        <b>新增编辑销售机会记录</b>
                </td>
            </tr>
        </table>
        <div runat="server" id="DivCustomer">
            <table align="center" class="TableBorder" bordercolor="#e6e6e6" cellspacing="0" cellpadding="3"
                border="1" style="border-collapse: collapse; width: 644px;">
                <tr>
                    <td align="left" class="st12pt" colspan="4" style="height: 23px">
                        <font color="#0000ff"><b><span style="color: #3333cc">客户信息：<asp:LinkButton ID="lnkbtnView"
                            runat="server" Visible="false">查看客户信息</asp:LinkButton></span></b></font>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        客户归属：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblOwner" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        客户电话：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblTelephone" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        客户传真：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblFax" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        下次联系时间：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblNextContactTime" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        联系人：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblName" runat="server"></asp:Label>&nbsp; 联系人手机：<asp:Label ID="lblMobilePhone"
                            runat="server"></asp:Label>&nbsp;联系人电话：<asp:Label ID="lblTelphone" runat="server"></asp:Label>&nbsp;
                        联系人QQ：<asp:Label ID="lblQQ" runat="server"></asp:Label>&nbsp;
                    </td>
                </tr>
            </table>
        </div>
        <table align="center" class="TableBorder" bordercolor="#e6e6e6" cellspacing="0" cellpadding="3"
            border="1" style="border-collapse: collapse; width: 644px;">
            <tr>
                <td align="left" class="st12pt" colspan="2" style="height: 23px">
                    <font color="#0000ff"><b><span style="color: #3333cc">销售机会信息：</span></b></font>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>机会主题：
                </td>
                <td align="left" style="width: 447px">
                    <div>
                        自动生成机会主题：<asp:LinkButton ID="lbtnProduct" runat="server" OnClick="lbtnProduct_Click">产品销售</asp:LinkButton>&nbsp;
                        <asp:LinkButton ID="lbtnAgent" runat="server" OnClick="lbtnAgent_Click">渠道代理</asp:LinkButton>
                        <asp:TextBox runat="server" ID="txtTopic" Width="404px"></asp:TextBox>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>客户名称：
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtCustomerName" Width="404px"></asp:TextBox>
                    <asp:Button ID="btnSelect" runat="server" Text="..." />
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    来源线索：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtCustomerClueName" runat="server" Width="180px" ReadOnly="true"></asp:TextBox><asp:Button
                        ID="btnSelectClue" runat="server" Text="选择" OnClientClick="return OpenClueDialog()" />
                    <asp:Button ID="btnClear" runat="server" Text="置空" OnClientClick="return clearClue()" />
                    <asp:HiddenField ID="hidfldCustomerClueId" runat="server" />
                    <script type="text/javascript">
                        function clearClue() {
                            document.getElementById('<%=hidfldCustomerClueId.ClientID %>').value = "";
                            document.getElementById('<%=txtCustomerClueName.ClientID %>').value = "";
                            return false;
                        }
                    </script>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>销售进程：
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlPhaseID" runat="server" Width="120px">
                    </asp:DropDownList>
                    <asp:Label ID="lblhelp0" runat="server" ForeColor="DarkOrange" Text="(？提示)" ToolTip="及时更新销售进程有利于机会的发展"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>机会类型：
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlBizTypeID" runat="server" Width="120px">
                        <asp:ListItem Value="0">终端销售</asp:ListItem>
                        <asp:ListItem Value="1">渠道代理</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>重要程度：
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlHotLevel" runat="server" Width="120px">
                        <asp:ListItem Value="0">普通</asp:ListItem>
                        <asp:ListItem Value="1">重要</asp:ListItem>
                        <asp:ListItem Value="2">很重要</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>相关产品：
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlProduct" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    <span style="color: #ff6633">*</span>业务跟进人：
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlTrackUserID" runat="server" DataTextField="RealName" DataValueField="Id">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    预期签单时间：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtExpectDate" runat="server" onfocus="WdatePicker()" Width="120px"></asp:TextBox>
                    <asp:Label ID="lblhelp1" runat="server" ForeColor="DarkOrange" Text="(？提示)" ToolTip="根据你对销售机会可能成单的日期填写"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    预期金额：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtExpectMoney" runat="server" Width="120px">0</asp:TextBox>
                    <asp:Label ID="lblhelp3" runat="server" ForeColor="DarkOrange" Text="(？提示)" ToolTip="尽量客观的填写这个数字"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px; height: 29px;">
                    可能性：
                </td>
                <td align="left" style="height: 29px;">
                    <asp:DropDownList ID="ddlProbability" runat="server">
                        <asp:ListItem Value="0">00%</asp:ListItem>
                        <asp:ListItem Value="10">10%</asp:ListItem>
                        <asp:ListItem Value="20">20%</asp:ListItem>
                        <asp:ListItem Value="30">30%</asp:ListItem>
                        <asp:ListItem Value="40">40%</asp:ListItem>
                        <asp:ListItem Value="50">50%</asp:ListItem>
                        <asp:ListItem Value="60">60%</asp:ListItem>
                        <asp:ListItem Value="70">70%</asp:ListItem>
                        <asp:ListItem Value="80">80%</asp:ListItem>
                        <asp:ListItem Value="90">90%</asp:ListItem>
                        <asp:ListItem Value="100">100%</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Label ID="lblhelp2" runat="server" ForeColor="DarkOrange" Text="(？提示)" ToolTip="注意填写和及时更新"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 120px">
                    备注信息：
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtRemark" Width="99%" Height="139px" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
        </table>
        <div runat="server" id="Info">
            <table align="center" class="TableBorder" bordercolor="#e6e6e6" cellspacing="0" cellpadding="3"
                border="1" style="width: 644px;">
                <tr>
                    <td align="right" style="width: 130px">
                        跟进人：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblTrackUser" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        创建人：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblCreateUser" runat="server"></asp:Label>
                        <asp:Label ID="lblCreateDate" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                        最后修改：
                    </td>
                    <td align="left">
                        <asp:Label ID="lblModifyMan" runat="server"></asp:Label>
                        <asp:Label ID="lblModifyDate" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 130px">
                    </td>
                    <td align="left">
                        <asp:CheckBox ID="cbClose" runat="server" Text="保存后关闭本页" />
                    </td>
                </tr>
            </table>
        </div>
        <table align="center" class="TableBorder" bordercolor="#e6e6e6" cellspacing="0" cellpadding="3"
            border="1" style="border-collapse: collapse; width: 644px;">
            <tr>
                <td align="center">
                    &nbsp;<asp:Button runat="server" ID="btnExe" Text="保  存" OnClick="btnExe_Click" />
                    &nbsp;<asp:Button runat="server" ID="btnCannal" Text="关  闭" OnClick="btnCannal_Click" />
                </td>
            </tr>
            <tr id="trAction" runat="server">
                <td align="left">
                    <table cellspacing="0" cellpadding="2" width="98%" border="0" align="center" style="margin-top: 5px;
                        border-right: #bbbbbb 1px solid; border-top: #bbbbbb 1px solid; border-left: #bbbbbb 1px solid;
                        border-bottom: #bbbbbb 1px solid;">
                        <tr>
                            <td align="left" colspan="2">
                                <b><font color="#3333cc">活动记录：</font></b>
                            </td>
                            <td align="right" colspan="2">
                                <asp:LinkButton ID="linkbtnAdd" runat="server">新增活动记录</asp:LinkButton>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" colspan="4">
                                <asp:GridView ID="gvAction" runat="server" AutoGenerateColumns="False" DataKeyNames="ActionID"
                                    Width="100%" OnRowDataBound="gvAction_RowDataBound">
                                    <HeaderStyle BackColor="#F0F0F0" HorizontalAlign="Center" Font-Size="13px" Height="22px" />
                                    <RowStyle BackColor="White" />
                                    <AlternatingRowStyle BackColor="Ivory" />
                                    <Columns>
                                        <asp:BoundField DataField="ActionID" HeaderText="编号" Visible="false">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="CreateDate" HeaderText="活动时间">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="ActionTypeName" HeaderText="活动类型">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Topic" HeaderText="主题">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="ContactMan" HeaderText="联系人">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="RealName" HeaderText="员工">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Content" HeaderText="活动内容">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="操作">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="Edit" runat="server" CausesValidation="false" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ActionID").ToString()%>'
                                                    CommandName="lbtEdit">编辑</asp:LinkButton>
                                                <asp:LinkButton ID="View" runat="server" CausesValidation="false" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ActionID").ToString()%>'
                                                    CommandName="lbtView">查看</asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <webdiyer:AspNetPager ID="plAction" runat="server" AlwaysShow="True" Direction="LeftToRight"
                                    FirstPageText="[首页]" HorizontalAlign="Right" LastPageText="[末页]" NextPageText="[下一页]"
                                    OnPageChanged="plAction_PageChanged" PrevPageText="[上一页]" ShowCustomInfoSection="Left"
                                    Width="100%">
                                </webdiyer:AspNetPager>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
        </table>
        <asp:HiddenField ID="txtCustomerID" runat="server" EnableViewState="False" />
    </div>
    </form>
</body>
</html>
