<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RW.aspx.cs" Inherits="WorkFlow.CRMManger.RW"
    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">
        .lblfont
        {
            padding: 2px 2px;
            vertical-align: middle;
            font-size: 18px;
        }
    </style>

    <script type="text/javascript">
     var prepareCommand = function (grid, command, record, row) {
            // you can prepare group command           
          if(command.command == 'Edit' &&  record.data.Statues =="完成" )
            {
                command.hidden = true;
                command.hideMode = 'visibility'; //you can try 'display' also    
            }
             if(command.command == 'Edit' &&  record.data.Statues =="转移" )
            {
                command.hidden = true;
                command.hideMode = 'visibility'; //you can try 'display' also    
            }
        };
            var prepareCommand1 = function (grid, command, record, row) {
            // you can prepare group command           
          if(command.command == 'Edit' &&  record.data.Statues =="完成" )
            {
                command.hidden = true;
                command.hideMode = 'visibility'; //you can try 'display' also    
            }
    
        };
    </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" AutoScroll="true">
        <Items>
            <ext:Panel ID="Panel5" runat="server" Region="North" Split="false" Height="86">
                <Content>
                    <ext:Hidden ID="hidZYInfomation" runat="server">
                    </ext:Hidden>
                    <table width="100%" style="background-color: #565656">
                        <tr>
                            <td align="center">
                                <div style="background-image: url('../FlowPage/icon/1new.png'); width: 880px; height: 10px">
                                </div>
                                <div style="background-image: url('../FlowPage/icon/2.png'); width: 880px; text-align: center">
                                    <table width="100%">
                                        <tr>
                                            <td align="center">
                                                <ext:Hidden ID="hidAccount" runat="server">
                                                </ext:Hidden>
                                                <table>
                                                    <tr>
                                                        <td style="padding-top: 2px; padding-bottom: 2px">
                                                            查询：
                                                            <ext:Hidden ID="Hidden1" runat="server">
                                                            </ext:Hidden>
                                                        </td>
                                                        <td style="padding-top: 2px; padding-bottom: 2px">
                                                            <ext:ComboBox ID="ComboBox2" runat="server" SelectedIndex="0" Width="100" Editable="false">
                                                                <Items>
                                                                    <ext:ListItem Text="主题" Value="主题" />
                                                                    <ext:ListItem Text="编号" Value="编号" />
                                                                    <ext:ListItem Text="负责人" Value="负责人" />
                                                                    <ext:ListItem Text="创建时间" Value="创建时间" />
                                                                </Items>
                                                                <DirectEvents>
                                                                    <Select OnEvent="Search_Change">
                                                                        <EventMask ShowMask="true" Msg="正在操作中，请稍后..." />
                                                                    </Select>
                                                                </DirectEvents>
                                                            </ext:ComboBox>
                                                        </td>
                                                        <td style="padding-top: 2px; padding-bottom: 2px; padding-left: 10px">
                                                            <ext:TextField ID="ZT" runat="server" Width="215" EmptyText="可根据主题模糊查询">
                                                            </ext:TextField>
                                                            <ext:TextField ID="BH" runat="server" Width="215" Hidden="true" EmptyText="可根据编号模糊查询">
                                                            </ext:TextField>
                                                            <ext:Panel ID="CJSJInfo" runat="server" Hidden="true" Border="false">
                                                                <Content>
                                                                    <table cellpadding="0" cellspacing="0">
                                                                        <tr>
                                                                            <td>
                                                                                <ext:TriggerField runat="server" ID="CJSJInfoStart" TriggerIcon="Date" Width="100"
                                                                                    Editable="false">
                                                                                    <Listeners>
                                                                                        <Focus Handler="WdatePicker({toDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                                                                        <TriggerClick Handler="WdatePicker({el:'CJSJInfoStart',toDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                                                                    </Listeners>
                                                                                </ext:TriggerField>
                                                                            </td>
                                                                            <td>
                                                                                <span style="margin-left: 3px; margin-right: 3px">至</span>
                                                                            </td>
                                                                            <td>
                                                                                <ext:TriggerField runat="server" ID="CJSJInfoEnd" TriggerIcon="Date" Width="100"
                                                                                    Editable="false">
                                                                                    <Listeners>
                                                                                        <Focus Handler="WdatePicker({toDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                                                                        <TriggerClick Handler="WdatePicker({el:'CJSJInfoEnd',toDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});" />
                                                                                    </Listeners>
                                                                                </ext:TriggerField>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </Content>
                                                            </ext:Panel>
                                                            <ext:ComboBox ID="FZR" runat="server" Width="145" DisplayField="Name" ValueField="LoginAccount"
                                                                Hidden="true" TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All"
                                                                ItemSelector="div.list-item" SelectOnFocus="true">
                                                                <Store>
                                                                    <ext:Store ID="SFZR" 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="Template10" runat="server">
                                                                    <Html>
                                                                    <tpl for=".">
						                                            <div class="list-item">
							                                             <h3>{LoginAccount}{Name}</h3>
							                                             {DepartmentName}, {PostionName}
						                                            </div>
					                                            </tpl>
                                                                    </Html>
                                                                </Template>
                                                            </ext:ComboBox>
                                                        </td>
                                                        <td style="padding-top: 2px; padding-bottom: 2px">
                                                            <ext:Button ID="Button32" runat="server" Text="立即查找" Icon="Zoom" ToolTip="立即查找">
                                                                <DirectEvents>
                                                                    <Click OnEvent="SearchInfo_Click">
                                                                        <EventMask ShowMask="true" Msg="正在查询中，请稍后..." />
                                                                    </Click>
                                                                </DirectEvents>
                                                            </ext:Button>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <img alt="" src="../images/filter.png" />
                                                        </td>
                                                        <td>
                                                            快速查询：
                                                        </td>
                                                        <td>
                                                            <ext:Hidden ID="hifKSCX" runat="server">
                                                            </ext:Hidden>
                                                            <ext:RadioGroup ID="KSCX" runat="server" Width="630">
                                                                <Items>
                                                                    <ext:Radio ID="Radio1" BoxLabel=" <span style='font-size: 14px'>未处理</span>" runat="server"
                                                                        Checked="true">
                                                                    </ext:Radio>
                                                                    <ext:Radio ID="Radio2" BoxLabel=" <span style='font-size: 14px'>跟进中</span>" runat="server">
                                                                    </ext:Radio>
                                                                    <ext:Radio ID="Radio4" BoxLabel=" <span style='font-size: 14px'>已转移</span>" runat="server">
                                                                    </ext:Radio>
                                                                    <ext:Radio ID="Radio3" BoxLabel=" <span style='font-size: 14px'>已完成</span>" runat="server">
                                                                    </ext:Radio>
                                                                </Items>
                                                                <Listeners>
                                                                    <Change Handler="DirectMethod.KSCXMethod()" />
                                                                </Listeners>
                                                            </ext:RadioGroup>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div style="background-image: url('../FlowPage/icon/1.png'); width: 880px; height: 10px">
                                </div>
                            </td>
                        </tr>
                    </table>
                </Content>
            </ext:Panel>
            <ext:Panel ID="Panel1" runat="server" Layout="Fit" Region="Center" Title="">
                <Items>
                    <ext:TabPanel ID="TabPanel1" runat="server" TabPosition="Bottom" Plain="true" Header="false"
                        Border="false" Title="Center">
                        <Items>
                            <ext:Panel ID="Panel10" runat="server" Title="<span style='font-size:14px'>原始任务</span>"
                                Layout="FitLayout">
                                <TopBar>
                                    <ext:Toolbar runat="server">
                                        <Content>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <ext:Label ID="lblCount" runat="server">
                                                        </ext:Label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </Content>
                                    </ext:Toolbar>
                                </TopBar>
                                <Items>
                                    <ext:GridPanel ID="GridPanel1" runat="server" Frame="true" StripeRows="true" AnimCollapse="false"
                                        Icon="Table" TrackMouseOver="true">
                                        <Store>
                                            <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData">
                                                <Reader>
                                                    <ext:JsonReader>
                                                        <Fields>
                                                            <ext:RecordField Name="CKKId" />
                                                            <ext:RecordField Name="ZT" />
                                                            <ext:RecordField Name="Rows" />
                                                            <ext:RecordField Name="FZR" />
                                                            <ext:RecordField Name="CreateDate" />
                                                            <ext:RecordField Name="CreateUser" />
                                                            <ext:RecordField Name="KH" />
                                                            <ext:RecordField Name="KHId" />
                                                            <ext:RecordField Name="NR" />
                                                            <ext:RecordField Name="Statues" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ColumnModel ID="ColumnModel2" runat="server">
                                            <Columns>
                                                <ext:Column Header="客户" DataIndex="KH" Width="260" />
                                                <ext:Column Header="主题 " DataIndex="ZT" Width="260">
                                                </ext:Column>
                                                <ext:Column Header="负责人" DataIndex="FZR" Width="70" />
                                                <ext:Column Header="创建人" DataIndex="CreateUser" Width="70" />
                                                <ext:Column Header="创建时间" DataIndex="CreateDate" Width="140" />
                                                <ext:Column Header="状态" DataIndex="Statues" Width="70" />
                                                <ext:ImageCommandColumn Width="83" Header="工具" GroupName="Rows">
                                                    <Commands>
                                                        <ext:ImageCommand CommandName="Edit" Icon="PageEdit" Text="做任务">
                                                        </ext:ImageCommand>
                                                    </Commands>
                                                    <PrepareCommand Fn="prepareCommand" />
                                                </ext:ImageCommandColumn>
                                            </Columns>
                                        </ColumnModel>
                                        <LoadMask ShowMask="true" />
                                        <DirectEvents>
                                            <Command OnEvent="Command">
                                                <EventMask ShowMask="true" Msg="<span style='font-size: 12px;'>正在操作中，请稍后...</span>"
                                                    MinDelay="10" />
                                                <ExtraParams>
                                                    <ext:Parameter Name="command" Value="command" Mode="Raw" />
                                                    <ext:Parameter Name="KH" Value="record.data.KH" Mode="Raw" />
                                                    <ext:Parameter Name="KHId" Value="record.data.KHId" Mode="Raw" />
                                                    <ext:Parameter Name="CKKId" Value="record.data.CKKId" Mode="Raw" />
                                                    <ext:Parameter Name="Rows" Value="record.data.Rows" Mode="Raw" />
                                                    <ext:Parameter Name="ZT" Value="record.data.ZT" Mode="Raw" />
                                                    <ext:Parameter Name="NR" Value="record.data.NR" Mode="Raw" />
                                                </ExtraParams>
                                            </Command>
                                        </DirectEvents>
                                        <SelectionModel>
                                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel2" runat="server" />
                                        </SelectionModel>
                                        <BottomBar>
                                            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="17" DisplayInfo="true"
                                                BeforePageText="<span style='font-size:12px'>第</span>" AfterPageText="<span style='font-size:12px'>页</span>"
                                                DisplayMsg="<span style='font-size:12px'>显示 {0} - {1}， 共 {2} 条</span>" EmptyMsg="<span style='font-size:12px'>无数据可以显示</span>"
                                                Cls="fontsize" />
                                        </BottomBar>
                                    </ext:GridPanel>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel2" runat="server" Title="<span style='font-size:14px'>对方转移任务</span>"
                                Layout="FitLayout">
                                <Items>
                                   <ext:GridPanel ID="GridPanel2" runat="server" Frame="true" StripeRows="true" AnimCollapse="false"
                                        Icon="Table" TrackMouseOver="true">
                                        <Store>
                                            <ext:Store ID="Store3" runat="server" OnRefreshData="Store3_RefreshData">
                                                <Reader>
                                                    <ext:JsonReader>
                                                        <Fields>
                                                            <ext:RecordField Name="CKKId" />
                                                            <ext:RecordField Name="ZT" />
                                                            <ext:RecordField Name="Rows" />
                                                            <ext:RecordField Name="FZR" />
                                                            <ext:RecordField Name="CreateDate" />
                                                            <ext:RecordField Name="CreateUser" />
                                                            <ext:RecordField Name="KH" />
                                                            <ext:RecordField Name="KHId" />
                                                            <ext:RecordField Name="NR" />
                                                            <ext:RecordField Name="Statues" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ColumnModel ID="ColumnModel1" runat="server">
                                            <Columns>
                                                <ext:Column Header="客户" DataIndex="KH" Width="260" />
                                                <ext:Column Header="主题 " DataIndex="ZT" Width="260">
                                                </ext:Column>
                                                <ext:Column Header="负责人" DataIndex="FZR" Width="70" />
                                                <ext:Column Header="创建人" DataIndex="CreateUser" Width="70" />
                                                <ext:Column Header="创建时间" DataIndex="CreateDate" Width="140" />
                                                <ext:Column Header="状态" DataIndex="Statues" Width="70" />
                                                <ext:ImageCommandColumn Width="83" Header="工具" GroupName="Rows">
                                                    <Commands>
                                                        <ext:ImageCommand CommandName="Edit" Icon="PageEdit" Text="做任务">
                                                        </ext:ImageCommand>
                                                    </Commands>
                                                    <PrepareCommand Fn="prepareCommand1" />
                                                </ext:ImageCommandColumn>
                                            </Columns>
                                        </ColumnModel>
                                        <LoadMask ShowMask="true" />
                                        <DirectEvents>
                                            <Command OnEvent="Command1">
                                                <EventMask ShowMask="true" Msg="<span style='font-size: 12px;'>正在操作中，请稍后...</span>"
                                                    MinDelay="10" />
                                                <ExtraParams>
                                                    <ext:Parameter Name="command" Value="command" Mode="Raw" />
                                                    <ext:Parameter Name="KH" Value="record.data.KH" Mode="Raw" />
                                                    <ext:Parameter Name="KHId" Value="record.data.KHId" Mode="Raw" />
                                                    <ext:Parameter Name="CKKId" Value="record.data.CKKId" Mode="Raw" />
                                                    <ext:Parameter Name="Rows" Value="record.data.Rows" Mode="Raw" />
                                                    <ext:Parameter Name="ZT" Value="record.data.ZT" Mode="Raw" />
                                                    <ext:Parameter Name="NR" Value="record.data.NR" Mode="Raw" />
                                                </ExtraParams>
                                            </Command>
                                        </DirectEvents>
                                        <SelectionModel>
                                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
                                        </SelectionModel>
                                        <BottomBar>
                                            <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="17" DisplayInfo="true"
                                                BeforePageText="<span style='font-size:12px'>第</span>" AfterPageText="<span style='font-size:12px'>页</span>"
                                                DisplayMsg="<span style='font-size:12px'>显示 {0} - {1}， 共 {2} 条</span>" EmptyMsg="<span style='font-size:12px'>无数据可以显示</span>"
                                                Cls="fontsize" />
                                        </BottomBar>
                                    </ext:GridPanel>
                                </Items>
                            </ext:Panel>
                        </Items>
                        <DirectEvents>
                            <TabChange OnEvent="ChageTab_Click">
                            </TabChange>
                        </DirectEvents>
                    </ext:TabPanel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    <ext:Window ID="Window5" runat="server" Closable="True" Resizable="false" Height="500"
        Constrain="true" Icon="Anchor" Title="<span style='font-size:14px'></span>" Draggable="true"
        CloseAction="Hide" Width="650" Modal="true" Padding="0" Hidden="true" AutoScroll="true">
        <Content>
            <table width="100%" style="background-color: white">
                <tr>
                    <td align="center">
                        <ext:Hidden ID="hidKHId" runat="server">
                        </ext:Hidden>
                        <ext:Hidden ID="hidRows" runat="server">
                        </ext:Hidden>
                        <table>
                            <tr>
                                <td align="center">
                                    <ext:HyperLink ID="hlZT" runat="server" Cls="lblfont">
                                    </ext:HyperLink>
                                </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <ext:HyperLink ID="hlNR" runat="server" Cls="lblfont">
                                    </ext:HyperLink>
                                </td>
                            </tr>
                        </table>
                        <table>
                            <tr>
                                <td align="left">
                                    <img alt="" src="../FlowPage/images/history_li.png" />
                                    进展内容：
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <ext:HtmlEditor ID="JD" runat="server">
                                    </ext:HtmlEditor>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <table width="100%">
                                        <tr>
                                            <td align="left">
                                                <table>
                                                    <tr>
                                                        <td align="left">
                                                            <img alt="" src="../FlowPage/images/history_li.png" />
                                                            进展状态：<span style="color: Red">*</span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <ext:RadioGroup ID="Statues" runat="server" Width="230">
                                                                <Items>
                                                                    <ext:Radio ID="Radio6" BoxLabel=" <span style='font-size: 14px'>跟进中</span>" runat="server">
                                                                    </ext:Radio>
                                                                    <ext:Radio ID="Radio7" BoxLabel=" <span style='font-size: 14px'>转移</span>" runat="server">
                                                                    </ext:Radio>
                                                                    <ext:Radio ID="Radio8" BoxLabel=" <span style='font-size: 14px'>完成</span>" runat="server">
                                                                    </ext:Radio>
                                                                </Items>
                                                                <Listeners>
                                                                    <Change Handler="DirectMethod.JZZTMethod()" />
                                                                </Listeners>
                                                            </ext:RadioGroup>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td align="right">
                                                <ext:Panel ID="ZY" runat="server" Border="false" Hidden="true">
                                                    <Content>
                                                        <table>
                                                            <tr>
                                                                <td align="left">
                                                                    <img alt="" src="../FlowPage/images/history_li.png" />
                                                                    转移至：<span style="color: Red">*</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <ext:ComboBox ID="ComboBox1" runat="server" DisplayField="Name" ValueField="LoginAccount"
                                                                       Width="197" TypeAhead="true" Mode="Local" ForceSelection="true"
                                                                        TriggerAction="All" ItemSelector="div.list-item" SelectOnFocus="true">
                                                                        <Store>
                                                                            <ext:Store ID="Store2" 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>
                                                            </tr>
                                                        </table>
                                                    </Content>
                                                </ext:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <ext:Button ID="Button1" runat="server" Text="保存任务进展" Icon="Disk" Scale="Medium">
                            <DirectEvents>
                                <Click OnEvent="AddRW_Click">
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                </tr>
            </table>
        </Content>
        <Listeners>
            <Hide Handler="DirectMethod.Window5Close();" />
        </Listeners>
    </ext:Window>
    </form>
</body>
</html>
