<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddKHGH.aspx.cs" Inherits="WorkFlow.CRMManger.AddKHGH"
    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>

</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="Hidden1" 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="Panel1" runat="server" Title="<span style='font-size: 12px;'>基本信息</span>"
                        FormGroup="true" AutoScroll="false">
                        <Content>
                            <ext:Hidden ID="hidAccount" runat="server">
                            </ext:Hidden>
                            <table cellspacing="9">
                                <tr>
                                    <td>
                                        关怀主题：<span style="color: Red">*</span>
                                    </td>
                                    <td style="padding-top: 2px; padding-bottom: 2px">
                                        <ext:TextField ID="GHZT" runat="server" Width="215">
                                        </ext:TextField>
                                    </td>
                                    <td>
                                        关怀日期 ：
                                    </td>
                                    <td style="padding-top: 2px; padding-bottom: 2px">
                                        <ext:TriggerField runat="server" ID="GHRQ" 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:'GHRQ',minDate:'%y-%M-{%d}',startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                            </Listeners>
                                        </ext:TriggerField>
                                    </td>
                                </tr>
                                <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:ComboBox ID="ZXR" runat="server" Width="215" DisplayField="Name" ValueField="LoginAccount"
                                        TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" ItemSelector="div.list-item"
                                        SelectOnFocus="true">
                                        <Store>
                                            <ext:Store ID="SZXR" 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="Template1" runat="server">
                                            <Html>
                                            <tpl for=".">
						<div class="list-item">
							 <h3>{LoginAccount}{Name}</h3>
							 {DepartmentName}, {PostionName}
						</div>
					</tpl>
                                            </Html>
                                        </Template>
                                    </ext:ComboBox>
                                </td>
                                <td>
                                    关怀类型 ：
                                </td>
                                <td style="padding-top: 2px; padding-bottom: 2px">
                                    <ext:ComboBox ID="GHLC" runat="server" SelectedIndex="0" Width="100">
                                        <Items>
                                            <ext:ListItem Text="邮件" Value="邮件" />
                                            <ext:ListItem Text="电话" Value="电话" />
                                            <ext:ListItem Text="传真" Value="传真" />
                                            <ext:ListItem Text="短信" Value="短信" />
                                            <ext:ListItem Text="其它" Value="其它" />
                                        </Items>
                                    </ext:ComboBox>
                                </td>
                            </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                    <ext:Panel ID="Panel2" runat="server" Title="<span style='font-size: 12px;'>关怀内容 </span>"
                        FormGroup="true" AutoScroll="false">
                        <Content>
                            <table cellspacing="9">
                                <tr>
                                    <td>
                                        <ext:HtmlEditor ID="GHNR" runat="server" Height="140">
                                        </ext:HtmlEditor>
                                    </td>
                                </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                    <ext:Panel ID="Panel3" runat="server" Title="<span style='font-size: 12px;'>客户反馈 </span>"
                        FormGroup="true" AutoScroll="false">
                        <Content>
                            <table cellspacing="9">
                                <tr>
                                    <td>
                                        <ext:HtmlEditor ID="KHFK" runat="server" Height="140">
                                        </ext:HtmlEditor>
                                    </td>
                                </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                    <ext:Panel ID="Panel4" runat="server" Title="<span style='font-size: 12px;'>描述信息 </span>"
                        FormGroup="true" AutoScroll="false">
                        <Content>
                            <table cellspacing="9">
                                <tr>
                                    <td>
                                        <ext:HtmlEditor ID="MSXX" runat="server" Height="140">
                                        </ext:HtmlEditor>
                                    </td>
                                </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
