<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddLXJL.aspx.cs" Inherits="WorkFlow.CRMManger.AddLXJL"
    ValidateRequest="false" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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="../FlowPage/css/main.css" rel="stylesheet" type="text/css" />
    <link href="../FlowPage/css/ext-all.css" rel="stylesheet" type="text/css" />

    <script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

    <style type="text/css">
        .cbStates-list
        {
            width: 298px;
            font: 11px tahoma,arial,helvetica,sans-serif;
        }
        .cbStates-list th
        {
            font-weight: bold;
        }
        .cbStates-list td, .cbStates-list th
        {
            padding: 3px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="DirectMethod">
    </ext:ResourceManager>
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:Panel ID="PList" runat="server" Region="Center" AutoScroll="true">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Hidden ID="hidAccount" runat="server">
                            </ext:Hidden>
                            <ext:Hidden ID="UpdateId" runat="server">
                            </ext:Hidden>
                            <ext:Button ID="Button3" runat="server" Text="保存" Icon="Disk" ToolTip="保存联系记录信息">
                                <DirectEvents>
                                    <Click OnEvent="Add_Click">
                                        <EventMask ShowMask="true" Msg="正在保存中，请稍后..." />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:Panel ID="Panel8" runat="server" Title="<span style='font-size: 12px;'>联系记录信息</span>"
                        FormGroup="true" AutoScroll="false">
                        <Content>
                            <table cellspacing="9">
                                <tr>
                                    <td>
                                        客户 ：<span style="color: Red">*</span>
                                    </td>
                                    <td style="padding-top: 2px; padding-bottom: 2px">
                                        <ext:ComboBox ID="KH" runat="server" Width="215" DisplayField="KHMC" ValueField="Id"
                                            TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" ItemSelector="tr.list-item"
                                            MinChars="1" ListWidth="300" PageSize="10" SelectOnFocus="true">
                                            <Store>
                                                <ext:Store ID="Store2" runat="server">
                                                    <Reader>
                                                        <ext:JsonReader IDProperty="Id">
                                                            <Fields>
                                                                <ext:RecordField Name="KHBH" />
                                                                <ext:RecordField Name="KHMC" />
                                                                <ext:RecordField Name="Id" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                    <AutoLoadParams>
                                                        <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                                        <ext:Parameter Name="limit" Value="10" Mode="Raw" />
                                                    </AutoLoadParams>
                                                </ext:Store>
                                            </Store>
                                            <Template ID="Template18" runat="server">
                                                <Html>
                                                <tpl for=".">
                            <tpl if="[xindex] == 1">
                                <table class="cbStates-list">
                                    <tr>
                                        <th>客户编号</th>
                                        <th>客户名称</th>
                                    </tr>
                            </tpl>
                            <tr class="list-item">
                                <td style="padding:3px 0px;">{KHBH}</td>
                                <td>{KHMC}</td>
                            </tr>
                       <tpl if="[xcount-xindex]==0">
                            </table>
                            </tpl> </tpl> </Html> </Template>
                            <triggers>
                                                <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                            </triggers>
                            <listeners>    
                           
                                                <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                                <TriggerClick Handler="if (index == 0) { this.focus().clearValue(); trigger.hide();}" />
                                                <Select Handler="this.triggers[0].show();DirectMethod.Search()" />
                                            </listeners>
                            </ext:ComboBox> </td>
                            <td>
                                联系人：
                            </td>
                            <td style="padding-top: 2px; padding-bottom: 2px">
                                <ext:ComboBox ID="LXR" runat="server" Width="100" DisplayField="XM" ValueField="Id"
                                    EmptyText="" TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All"
                                    ItemSelector="div.list-item" SelectOnFocus="true" SelectedIndex="0">
                                    <Store>
                                        <ext:Store ID="SLXR" runat="server">
                                            <Reader>
                                                <ext:JsonReader IDProperty="Id">
                                                    <Fields>
                                                        <ext:RecordField Name="XM" />
                                                        <ext:RecordField Name="Id" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <Template ID="Template3" runat="server">
                                        <Html>
                                        <tpl for=".">
                                            <div class="list-item">
                                                 <h3>{XM}</h3>							
                                            </div>
                                        </tpl>
                                        </Html>
                                    </Template>
                                </ext:ComboBox>
                            </td>
                            </tr>
                            <tr>
                                <td>
                                    主题：<span style="color: Red">*</span>
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:TextField ID="ZT" runat="server" Width="215">
                                    </ext:TextField>
                                </td>
                                <td>
                                    联系类型：<span style="color: Red">*</span>
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:ComboBox ID="LXLX" runat="server" Width="215" DisplayField="FLName" ValueField="Id"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" ItemSelector="div.list-item"
                                        SelectOnFocus="true">
                                        <Store>
                                            <ext:Store ID="SLXLX" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="FLName" />
                                                            <ext:RecordField Name="Id" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template10" runat="server">
                                            <Html>
                                            <tpl for=".">
						                        <div class="list-item">
							                         <h3>{FLName}</h3>							
						                        </div>
					                        </tpl>
                                            </Html>
                                        </Template>
                                    </ext:ComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    联系时间：<span style="color: Red">*</span>
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:TriggerField runat="server" ID="LXSJ" TriggerIcon="Date" Width="100" Editable="false">
                                        <Listeners>
                                            <Focus Handler="WdatePicker({minDate:'%y-%M-{%d}',startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                            <TriggerClick Handler="WdatePicker({el:'LXSJ',minDate:'%y-%M-{%d}',startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                        </Listeners>
                                    </ext:TriggerField>
                                </td>
                                <td>
                                    负责人：<span style="color: Red">*</span>
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:ComboBox ID="FZR" runat="server" Width="215" DisplayField="Name" ValueField="LoginAccount"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" EmptyText="选择一个负责人"
                                        ItemSelector="div.list-item" SelectOnFocus="true">
                                        <Store>
                                            <ext:Store ID="Store1" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="LoginAccount">
                                                        <Fields>
                                                            <ext:RecordField Name="DepartmentName" />
                                                            <ext:RecordField Name="Name" />
                                                            <ext:RecordField Name="PostionName" />
                                                            <ext:RecordField Name="LoginAccount" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template2" runat="server">
                                            <Html>
                                            <tpl for=".">
						                                    <div class="list-item">
							                                     <h3>{LoginAccount}{Name}</h3>
							                                     {DepartmentName}, {PostionName}
						                                    </div>
					                                    </tpl>
                                            </Html>
                                        </Template>
                                    </ext:ComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    销售阶段：
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:ComboBox ID="XSJD" runat="server" Width="215" DisplayField="FLName" ValueField="Id"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" ItemSelector="div.list-item"
                                        SelectOnFocus="true">
                                        <Store>
                                            <ext:Store ID="SXSJD" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="FLName" />
                                                            <ext:RecordField Name="Id" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template1" runat="server">
                                            <Html>
                                            <tpl for=".">
						                        <div class="list-item">
							                         <h3>{FLName}</h3>							
						                        </div>
					                        </tpl>
                                            </Html>
                                        </Template>
                                    </ext:ComboBox>
                                </td>
                                <td>
                                    客户状态：
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:ComboBox ID="KHZT" runat="server" Width="215" DisplayField="FLName" ValueField="Id"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" ItemSelector="div.list-item"
                                        SelectOnFocus="true">
                                        <Store>
                                            <ext:Store ID="SKHZT" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="FLName" />
                                                            <ext:RecordField Name="Id" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Template ID="Template5" runat="server">
                                            <Html>
                                            <tpl for=".">
						                                    <div class="list-item">
							                                     <h3>{FLName}</h3>							
						                                    </div>
					                                    </tpl>
                                            </Html>
                                        </Template>
                                    </ext:ComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    下次回访日期：
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:TriggerField runat="server" ID="XCHFRQ" TriggerIcon="Date" Width="100" Editable="false">
                                        <Listeners>
                                            <Focus Handler="WdatePicker({minDate:'%y-%M-{%d}',startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                            <TriggerClick Handler="WdatePicker({el:'XCHFRQ',minDate:'%y-%M-{%d}',startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                        </Listeners>
                                    </ext:TriggerField>
                                </td>
                                <td>
                                    销售机会：
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:TextField ID="XSJH" runat="server" Width="215">
                                    </ext:TextField>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    內容：
                                </td>
                                <td colspan="3">
                                    <ext:HtmlEditor ID="NR" runat="server" Height="190" Width="600">
                                    </ext:HtmlEditor>
                                </td>
                            </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
