<table border="0" align="center" cellpadding="0" cellspacing="0" id="mian" ms-controller="SalesFunnel">
    <tbody>
        <tr>
            <td width="198" height="450" valign="top" id="tdleft">
                <!--leftNav-->
                <div id="left" ms-widget="leftMenu">
                </div>
                <!--End leftNav-->
            </td>
            <td valign="top" id="right" class="addrightbg">
                <div class="boxtip" id="boxtip">
                    <h1>销售漏斗</h1>
                    <p>销售漏斗的意义在于，通过直观的图形方式，指出公司的客户资源从潜在客户阶段，发展到意向客户阶段、谈判阶段和成交阶段的比例关系，或者说是转换率。</p>
                    <!--<a href="javascript:history.go(-1)" class="btn_back"></a>-->
                </div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="titbox">
                    <tbody>
                        <tr>
                            <td width="81" height="30" class="tit">条件范围
                            </td>
                            <td>&nbsp;
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr>
                            <td width="70">归属营销战役：
                            </td>
                            <td width="41%">
                                <input type="hidden" ms-duplex="MarketingCampaign" />
                                <input type="text" ms-duplex="MarketingCampaignDisplay" readonly="readonly">
                                <button type="button" class="myfbt" ms-click="selectCampaign">
                                    <i class="customer"></i>
                                </button>
                                <div ms-visible="campaignPanel" class="dropdownPanel" style="width: 610px; position: absolute;" ms-mousedown="mousedownstop">
                                    <div>
                                        <div class="boxTitlenob" style="margin-left: 0;">
                                            <h2>
                                                <span class="rseachbox">
                                                    <input style="margin-bottom: 0px;" ms-duplex="campaignKey" type="text">
                                                    <button type="button" class="inputbt" ms-click="searchCampaign">
                                                    </button>
                                                </span>
                                                <span style="float: right">
                                                    <button type="button" ms-click="closeCampaignPanel">{{lang.Close}}</button>
                                                    <button type="button" ms-click="clearCampaignValue">清空</button>
                                                </span>
                                            </h2>
                                        </div>
                                        <div style="height: 200px; overflow: auto; background-color: rgb(255, 255, 255);">
                                            <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                                                <thead>
                                                    <tr class="head">
                                                        <td width="20%" align="center">{{lang.CampaignTitle}}</td>
                                                        <td width="8%" align="center">{{lang.CampaignType}}</td>
                                                        <td width="10%" align="center">{{lang.StartDate}}</td>
                                                        <td width="10%" align="center">{{lang.EndDate}}</td>
                                                        <td width="7%" align="center">{{lang.CampaignSponsor}}</td>
                                                    </tr>
                                                </thead>
                                                <tbody ms-each-item="campaignList">
                                                    <tr style="background-color: rgb(255, 255, 255); cursor: pointer;" ms-live-click="clickCampaign" ms-attr-key="item.Id" ms-attr-alt="item.CampaignTheme" title="点击选择">
                                                        <td align="center">{{item.CampaignTheme}}
                                                        </td>
                                                        <td align="center">{{item.CampaignTypeDisplay}}
                                                        </td>
                                                        <td align="center">{{item.StartDate | truncate(10,'')}}
                                                        </td>
                                                        <td align="center">{{item.EndDate | truncate(10,'')}}
                                                        </td>
                                                        <td align="center">{{item.CampaignSponsorDisplay}}
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </td>
                            <td width="70">归属市场活动：
                            </td>
                            <td width="41%">
                                <input type="hidden" ms-duplex="MarketActivity" />
                                <input type="text" readonly="readonly" ms-duplex="MarketActivityDisplay">
                                <button type="button" class="myfbt" ms-click="selectActivity">
                                    <i class="customer"></i>
                                </button>
                                <div ms-visible="activityPanel" class="dropdownPanel" style="width: 610px; right: 20px; position: absolute;" ms-mousedown="mousedownstop">
                                    <div>
                                        <div class="boxTitlenob" style="margin-left: 0;">
                                            <h2>
                                                <span class="rseachbox">
                                                    <input style="margin-bottom: 0px;" ms-duplex="activityKey" type="text">
                                                    <button type="button" class="inputbt" ms-click="searchActivity">
                                                    </button>
                                                </span>
                                                <span style="float: right">
                                                    <button type="button" ms-click="closeActivityPanel">{{lang.Close}}</button>
                                                    <button type="button" ms-click="clearActivityValue">清空</button>
                                                </span>
                                            </h2>
                                        </div>
                                        <div style="height: 200px; overflow: auto; background-color: rgb(255, 255, 255);">
                                            <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                                                <thead>
                                                    <tr class="head">
                                                        <td width="20%" align="center">{{lang.ActivityTheme}}</td>
                                                        <td width="8%" align="center">{{lang.ActivityType}}</td>
                                                        <td width="15%" align="center">{{lang.ConscientiousPerson}}</td>
                                                        <td width="8%" align="center">{{lang.CostBudget}}</td>
                                                        <td width="10%" align="center">{{lang.DiscountType}}</td>
                                                        <td width="15%" align="center">{{lang.StartDate}}</td>
                                                        <td width="15%" align="center">{{lang.EndDate}}</td>
                                                    </tr>
                                                </thead>
                                                <tbody ms-each-item="activityList">
                                                    <tr style="background-color: rgb(255, 255, 255); cursor: pointer;" ms-live-click="clickActivity" ms-attr-key="item.Id" ms-attr-alt="item.ActivityTheme" title="点击选择">
                                                        <td align="center">{{item.ActivityTheme}}
                                                        </td>
                                                        <td align="center">{{item.ActivityTypeDisplay}}
                                                        </td>
                                                        <td align="center">{{item.ConscientiousPersonDisplay}}
                                                        </td>
                                                        <td align="right">{{item.CostBudget}}
                                                        </td>
                                                        <td align="center">{{item.DiscountType}}
                                                        </td>
                                                        <td align="center">{{item.StartDate|truncate(10,'')}}
                                                        </td>
                                                        <td align="center">{{item.EndDate|truncate(10,'')}}
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="90">归属部门：
                            </td>
                            <td width="40%">
                                <input type="hidden" ms-duplex="GroupId">
                                <input ms-duplex='GroupName' type="text" readonly="readonly">
                                <span>
                                    <button onclick="" type="button" class="myfbt" ms-widget='dropDownGroupTree,inputGroupTree,inputGroupTreeOpts'>
                                        <i class="bm"></i>
                                    </button>
                                </span>

                            </td>
                            <td width="90">机会跟单人：
                            </td>
                            <td width="40%">
                                <input type="hidden" ms-duplex="OfferSponsor" />
                                <input type="text" ms-duplex="OfferSponsorDisplay" readonly="readonly" />
                                <button type="button" class="myfbt" ms-click="selectOfferSponsor()"><i class="iadduser"></i></button>
                            </td>
                        </tr>
                        <tr>
                            <td>发现机会时间：
                            </td>
                            <td colspan="3">
                                <input type="text" ms-duplex="StartDate" ms-widget="date,startdateid,startdataOpts" style="width: 84px" readonly="readonly" />
                                <span style="margin-left: -14px;">至</span>
                                <input type="text" ms-duplex="EndDate" ms-widget="date,enddateid,enddateOpts" style="width: 84px" readonly="readonly" />
                                <button type="button" class="myfbt2" ms-click="doSearch"><i class="customer"></i>搜索</button>
                                <button type="button" class="myfbt2" ms-click="doShowAll">显示全部</button>
                                <div class="tip" title="温馨小提示" style="font-size: 13px; color: #959595; line-height: 13px; display: inline-block;">
                                    销售漏斗：仅统计“状态=跟踪”的销售机会。
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="seabox">
                                <table class="seacrhField">
                                    <tr>
                                        <td class="seabox">
                                            <span class="first">筛选条件：</span>
                                            <div style="display: inline;" ms-with="showItem">
                                                <span class="searchItem" ms-if="$val">{{$val}}<i><a href="javascript:void(0)" ms-click="removeItem"></a></i></span>
                                            </div>
                                            <span class="last" ms-if="has"><a href="javascript:void(0)" ms-click="doShowAll">{{lang.ClearAll}}</a></span>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <hr style="border: 1px solid #eee; width: 99%; margin: 10px 0;">
                <table width="100%" border="0" cellspacing="1" cellpadding="0" style="margin-top: 10px;">
                    <tbody>
                        <tr>
                            <td width="40%">
                                <div id="chartdiv"></div>
                            </td>
                            <td style="vertical-align: top;">
                                <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="sellsTotal">
                                    <caption style="font-size: 15px; font-weight: bold;">
                                        各阶段机会预期成交金额
                                    </caption>
                                    <thead>
                                        <tr class="minhead" align="center">
                                            <td width="3%">
                                                <input type="checkbox" ms-checked="checkAll" ms-click="checkAllCall" />
                                            </td>
                                            <td width="10%">所处阶段
                                            </td>
                                            <td width="10%">销售机会数
                                            </td>
                                            <td width="10%">所占比例
                                            </td>
                                            <td width="10%">预期成交金额
                                            </td>
                                        </tr>
                                    </thead>
                                    <tbody ms-each-item="salasGroup">
                                        <tr ms-class-old="$index % 2" ms-class-even="!($index % 2)" ms-hover="hover">
                                            <td align="center">
                                                <input type="checkbox" ms-checked="item.check" ms-click="checkCall" />
                                            </td>
                                            <td>{{item.FollowStageDisplay}}
                                            </td>
                                            <td align="right">{{item.NumOfSells}}
                                            </td>
                                            <td align="right">{{item.SellsPercents}} %
                                            </td>
                                            <td align="right">{{item.ExpectAmount | number}} 元
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="boxTitlenob" style="margin-top: 10px;">
                    <h2>销售机会</h2>
                </div>
                <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="tableList">
                    <thead>
                        <tr class="head">
                            <td width="25%" align="center">机会主题
                            </td>
                            <td width="20%" align="center">客户/联系人
                            </td>
                            <td width="10%" align="center">机会跟单人
                            </td>
                            <td width="7%" align="center">预计签单日期
                            </td>
                            <td width="7%" align="center">预计金额
                            </td>
                            <td width="6%" align="center">可能性
                            </td>
                            <td width="6%" align="center">阶段
                            </td>
                            <td width="6%" align="center">状态
                            </td>
                            <td width="6%" align="center">阶段停留
                            </td>
                        </tr>
                    </thead>
                    <tbody ms-each-item="salasList">
                        <tr ms-class-old="$index % 2" ms-class-even="!($index % 2)" ms-hover="hover">
                            <td align="left">
                                <a href="javascript:void(0)" ms-live-click="doviews" ms-attr-path="'/Market/SalesOpportunities/'+item.Id+'/view'">{{item.Title}}</a>
                            </td>
                            <td align="left">
                                <a href="javascript:void(0)" ms-click="doviews" ms-attr-path="'/Customer/DetailCustomer/' + item.Customer">{{item.CustomerDisplay}}</a> / 
                          <!--      <a ms-href="'#/Customer/Contacts/'+item.CustomerContact">-->
                                    
                                     <a href="javascript:void(0)" ms-live-click="doviews" ms-attr-path="'/Customer/Contacts/'+item.CustomerContact+'/view'">
                                    
                                    {{item.CustomerContactDisplay}}</a>
                            </td>
                            <td align="center">
                                <a href="javascript:void(0);" ms-widget='userCard' ms-data-userid="item.OpportunitiesFollow">{{item.OpportunitiesFollowDisplay|truncate(25,"……")}}
                                </a>
                            </td>
                            <td align="center">{{item.ExpectSigningDate|truncate(10,'')}}
                            </td>
                            <td align="right">{{item.ExpectAmount | number}} 元
                            </td>
                            <td align="right">{{item.OpportunitiesPossibility}} %
                            </td>
                            <td align="center">{{item.FollowStage|followDisplay}}
                            </td>
                            <td align="center">{{item.State|stageDisplay}}
                            </td>
                            <td align="center">{{item.RemainDay}} 天
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="9" ms-widget='paging,upaing,userpaing'></td>
                        </tr>
                    </tfoot>
                </table>
            </td>
        </tr>
    </tbody>
</table>
