<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) //首次加载
        {
            if (Request.QueryString["itemid"] != null)
            {
                this.txt_SalesOpportunityID.Text = Request.QueryString["itemid"].ToString();
            }
        }
    }

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <title>BPM Form</title>
    <style>
        BODY {
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;

        }

        TABLE {
            border-collapse: collapse;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        P {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 0px;
            PADDING-BOTTOM: 0px;
            MARGIN: 0px;
            PADDING-TOP: 0px;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TD {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 2px;
            PADDING-BOTTOM: 0px;
        }

            TD.NoPadding {
                PADDING-RIGHT: 0px;
                PADDING-LEFT: 0px;
                PADDING-BOTTOM: 0px;
                PADDING-TOP: 0px;
            }

        INPUT {
            HEIGHT: 20px;
        }

            INPUT.UL {
                BORDER-RIGHT: medium none;
                BORDER-TOP: medium none;
                BORDER-LEFT: medium none;
                BORDER-BOTTOM: #33ff33 1px solid;
            }

        TEXTAREA {
            FONT-SIZE: 12px;
        }
    </style>
    <script type="text/javascript">

        Ext.onReady(function () {

            rbt1_change();

        });

        function rbt1_change() {
            var radio0 = document.getElementById("Xrdo_Category_0"); //活动记录
            var radio1 = document.getElementById("Xrdo_Category_1"); //工作计划
            if (radio0.checked == true) {

                document.getElementById("lblName").innerHTML = "活动记录";
                document.getElementById("lblPlanDate").style.display = "none";
                //document.getElementById("dtpPlanDate").getElementsByTagName("input")[0].style.display = "none";
                document.getElementById("dtpPlanDate").style.display = "none";
                document.getElementById("tr1").style.display = "none";
                document.getElementById("tr2").style.display = "none";
                document.getElementById("tr3").style.display = "none";

            }
            if (radio1.checked == true) {

                document.getElementById("lblName").innerHTML = "工作计划";
                document.getElementById("lblPlanDate").style.display = "";
                document.getElementById("dtpPlanDate").style.display = "";
                document.getElementById("tr1").style.display = "";
                document.getElementById("tr2").style.display = "";
                document.getElementById("tr3").style.display = "";
            }
        }

        function txt_onblur() {
            var nowdate = getDate();
            agent.Eles[document.getElementById("XDateTimePicker3").getAttribute("xform_xele_index")].setValue(nowdate);
        }

        //获取系统当前日期
        function getDate() {

            var myDate = new Date();
            //获取当前年
            var year = myDate.getFullYear();
            //获取当前月
            var month = myDate.getMonth() + 1;
            //获取当前日
            var date = myDate.getDate();
            var h = myDate.getHours(); //获取当前小时数(0-23)
            var m = myDate.getMinutes(); //获取当前分钟数(0-59)
            var s = myDate.getSeconds();
            //获取当前时间
            var now = year + '-' + conver(month) + "-" + conver(date) + " " + conver(h) + ':' + conver(m) + ":" + conver(s);
            //var now = myDate.toLocaleString(); //获取日期与时间
            return now;
        }
        //日期时间处理
        function conver(s) {
            return s < 10 ? '0' + s : s;
        }

    </script>
</head>
<body>
    <form runat="server">
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo">
                    </td>
                    <td width="1000" class="biaoti">
                        <asp:Label id="Label1" runat="server" text="活动/计划"></asp:Label></td>
                    <td width="400" class="formno">
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="22" class="title1" colspan="4">
                        <asp:Label id="Label8" runat="server" text="活动信息"></asp:Label>
                        <aspxform:XDropDownList id="XDropDownList2" runat="server" DataMap="ownerId->DF_CRM_ActivityRecord.SalesManID;ownerName->DF_CRM_ActivityRecord.SalesManName;opportunityName->DF_CRM_ActivityRecord.SalesOpportunityName;STPName->DF_CRM_ActivityRecord.CustomerName;STPSapID->DF_CRM_ActivityRecord.CustomerID;CustomerID->DF_CRM_ActivityRecord.CustomerID" XDataSource="TableName:DF_CRM_SalesOpportunities;Filter:ItemId->DF_CRM_ActivityRecord.SalesOpportunityID" Express="DF_CRM_ActivityRecord.SalesOpportunityID" ValueColumn="ItemId" DisplayColumn="ItemId" HiddenExpress="1"></aspxform:XDropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label22" runat="server" text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="Label21" runat="server" text="类别"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XRadioButtonList id="Xrdo_Category" onclick="rbt1_change()" runat="server" RepeatDirection="Horizontal" XDataBind="DF_CRM_ActivityRecord.Category">
                            <asp:ListItem Selected="True">活动记录</asp:ListItem>
                            <asp:ListItem>工作计划</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label16" runat="server" text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="Label3" runat="server" text="活动类型"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" XDataBind="DF_CRM_ActivityRecord.Type" Width="120px" PromptText="--请选择--">
                            <asp:ListItem>拜访</asp:ListItem>
                            <asp:ListItem>电话</asp:ListItem>
                            <asp:ListItem>宴请</asp:ListItem>
                            <asp:ListItem>培训</asp:ListItem>
                            <asp:ListItem>展会</asp:ListItem>
                            <asp:ListItem>其他</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr>
                    <td width="126" height="18" class="tsbottomlabel">
                        <asp:Label id="Label9" runat="server" text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="lblName" runat="server" text="活动记录"></asp:Label></td>
                    <td width="449" class="tsbottomtext" colspan="3">
                        <aspxform:XTextBox id="XTextBox4" runat="server" XDataBind="DF_CRM_ActivityRecord.Name" Width="100%" HiddenInput="False" Min="0" Max="0" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px" DisableBehavior="ReadOnly" TextMode="MultiLine" Rows="3"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="20" class="tsbottomlabel">
                        <asp:Label id="Label19" runat="server" text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="Label4" runat="server" text="业务员"></asp:Label> 
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_CRM_ActivityRecord.SalesManID" Width="10px" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_CRM_ActivityRecord.SalesManName" Width="70%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="lblPlanDate" runat="server" text="计划日期"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDateTimePicker id="dtpPlanDate" runat="server" XDataBind="DF_CRM_ActivityRecord.PlanDate" Width="50%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly"></aspxform:XDateTimePicker>
                    </td>
                </tr>
                <tr>
                    <td height="26" class="tsbottomlabel">
                        <asp:Label id="Label12" runat="server" text="销售机会"></asp:Label>
                        <aspxform:XTextBox id="txt_SalesOpportunityID" runat="server" XDataBind="DF_CRM_ActivityRecord.SalesOpportunityID" Width="39px" HiddenInput="True" Min="0" Max="0" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="DF_CRM_ActivityRecord.SalesOpportunityName" Width="70%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8" ReadOnly="True"></aspxform:XTextBox>
                        &nbsp;<aspxform:XDataBrowserButton id="XDataBrowserButton2" runat="server" DataMap="ItemId->DF_CRM_ActivityRecord.SalesOpportunityID;ownerId->DF_CRM_ActivityRecord.SalesManID;ownerName->DF_CRM_ActivityRecord.SalesManName;opportunityName->DF_CRM_ActivityRecord.SalesOpportunityName;STPName->DF_CRM_ActivityRecord.CustomerName;STPSapID->DF_CRM_ActivityRecord.CustomerID" XDataSource="TableName:DF_CRM_SalesOpportunities" XClass="YZSoft.Forms.Field.DataBrowserButton" Width="40px" DisplayColumns="SalesmanID:;opportunityName:销售机会名称;CustomerName:客户" Height="22px" PopupWndWidth="-1" PopupWndHeight="-1" UseSubmitBehavior="False" Text="查询"></aspxform:XDataBrowserButton>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label18" runat="server" text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="Label13" runat="server" text="客户名称"></asp:Label> 
                        <aspxform:XTextBox id="XTextBox13" runat="server" XDataBind="DF_CRM_ActivityRecord.CustomerID" Width="10px" HiddenInput="True" Min="0" Max="0" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox7" runat="server" XDataBind="DF_CRM_ActivityRecord.CustomerName" Width="70%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8"></aspxform:XTextBox>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton1" runat="server" DataMap="CustomerID->DF_CRM_ActivityRecord.CustomerID;CustomerNameCH->DF_CRM_ActivityRecord.CustomerName" XDataSource="TableName:V_DF_MasterData_Customer" XClass="YZSoft.Forms.Field.DataBrowserButton" Width="40px" DisplayColumns="CustomerNameCH:客户名称" Height="22px" PopupWndWidth="-1" PopupWndHeight="-1" UseSubmitBehavior="False" Text="查询" PrintOut="False" DisableExpress='DF_CRM_ActivityRecord.SalesOpportunityID!=""'></aspxform:XDataBrowserButton>
                    </td>
                </tr>
                <tr>
                    <td height="23" class="tsbottomlabel">
                        <asp:Label id="Label14" runat="server" text="联系人"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox8" runat="server" XDataBind="DF_CRM_ActivityRecord.ContactsName" Width="70%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label5" runat="server" text="部门或院系"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDropDownList id="XDropDownList5" runat="server" XDataSource='TableName:DF_DataSourceList;Filter:Type->"部门";OrderBy:OrderID' ValueColumn="Name" DisplayColumn="Name" XDataBind="DF_CRM_ActivityRecord.Department" Width="120px" PromptText="--请选择--">
                            <asp:ListItem>未执行</asp:ListItem>
                            <asp:ListItem>执行未达</asp:ListItem>
                            <asp:ListItem>达到目标</asp:ListItem>
                            <asp:ListItem>超出预期</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr id="tr1">
                    <td height="67" class="tsbottomlabel">
                        <asp:Label id="Label15" runat="server" text="活动目的与内容"></asp:Label></td>
                    <td class="tsbottomtext" colspan="3">
                        <aspxform:XTextBox id="XTextBox9" runat="server" XDataBind="DF_CRM_ActivityRecord.Contents" Width="100%" HiddenInput="False" Min="0" Max="0" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px" DisableBehavior="ReadOnly" Height="68px" TextMode="MultiLine" Rows="3"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr id="tr2">
                    <td height="21" class="tsbottomlabel">
                        <asp:Label id="Label2" runat="server" text="实际执行日期"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" XDataBind="DF_CRM_ActivityRecord.ExecDate" Width="50%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly"></aspxform:XDateTimePicker>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label6" runat="server" text="执行情况"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDropDownList id="XDropDownList3" runat="server" XDataBind="DF_CRM_ActivityRecord.PerformCondition" Width="120px" PromptText="--请选择--">
                            <asp:ListItem>未执行</asp:ListItem>
                            <asp:ListItem>执行未达</asp:ListItem>
                            <asp:ListItem>达到目标</asp:ListItem>
                            <asp:ListItem>超出预期</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr id="tr3">
                    <td class="tsbottomlabel">
                        <asp:Label id="Label7" runat="server" text="执行说明"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="DF_CRM_ActivityRecord.PerformExplain" Width="100%" ValueToDisplayText BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel">
                    </td>
                    <td class="tsbottomtext">
                    </td>
                </tr>
                <tr>
                    <td height="19" class="tsbottomlabel">
                        <asp:Label id="Label10" runat="server" text="重点用户"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XCheckBox id="XCheckBox1" runat="server" XDataBind="DF_CRM_ActivityRecord.EmphasisUser"></aspxform:XCheckBox>
                    </td>
                    <td class="tsbottomlabel">
                    </td>
                    <td class="tsbottomtext">
                    </td>
                </tr>
                <tr>
                    <td height="53" class="tsbottomlabel">
                        <asp:Label id="Label17" runat="server" text="经理点评"></asp:Label></td>
                    <td class="tsbottomtext" colspan="3">
                        <aspxform:XTextBox id="txt_ManagerReview" runat="server" XDataBind="DF_CRM_ActivityRecord.ManagerReview" Width="100%" HiddenInput="False" Min="0" Max="0" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px" DisableBehavior="ReadOnly" Height="54px" onchange="txt_onblur()"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label11" runat="server" text="经理点评日期"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDateTimePicker id="XDateTimePicker3" runat="server" XDataBind="DF_CRM_ActivityRecord.ReviewsDate" Width="50%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" Type="TimeMinutes" BackColor="#E6F1F8" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                    <td class="tsbottomlabel">
                    </td>
                    <td class="tsbottomtext">
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label24" runat="server" text="创建日期"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDateTimePicker id="XDateTimePicker4" runat="server" XDataBind="DF_CRM_ActivityRecord.CreateDate" Width="50%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label25" runat="server" text="最后更新日期"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDateTimePicker id="XDateTimePicker5" runat="server" XDataBind="DF_CRM_ActivityRecord.UpdateDate" Width="50%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#E6F1F8" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                </tr>
            </tbody>
        </table>
        <p>
        </p>
        <p>
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator5" ValidationGroup="submit" runat="server" Display="None" ErrorMessage="请选择类别" ControlToValidate="Xrdo_Category" ForeColor="Red">请选择类别</aspxform:XRequiredFieldValidator>
            &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" ValidationGroup="submit" runat="server" Display="None" ErrorMessage="请选择活动类型" ControlToValidate="XDropDownList1" ForeColor="Red">请选择活动类型</aspxform:XRequiredFieldValidator>
            &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" ValidationGroup="submit" runat="server" Display="None" ErrorMessage="请输入活动记录/工作计划名称" ControlToValidate="XTextBox4" ForeColor="Red">请输入活动记录/工作计划名称</aspxform:XRequiredFieldValidator>
            &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" ValidationGroup="submit" runat="server" DisableExpress='DF_CRM_ActivityRecord.Category!="工作计划"' Display="None" ErrorMessage="请选择计划日期" ControlToValidate="dtpPlanDate" ForeColor="Red">请选择计划日期</aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator4" ValidationGroup="submit" runat="server" Display="None" ErrorMessage="请选择客户" ControlToValidate="XTextBox7" ForeColor="Red">请选择客户</aspxform:XRequiredFieldValidator>
            &nbsp; 
        </p>
    </form>
</body>
</html>
