<div style="min-height: 250px">
    <div ms-visible="ifShowDMenu" style="position: absolute;" id="cDMenu" ms-mouseover="showDmenu(true)" ms-mouseout="showDmenu(false)">
        <ul class="addlist2">
            <li><a ms-click="doview2(1)" href="javascript:void(0)">客户详情</a></li>
            <li ms-if="authContacts"><a ms-click="doview2(2)" href="javascript:void(0)">联系人</a></li>
            <li ms-if="authSalesOpportunities"><a ms-click="doview2(3)" href="javascript:void(0)">销售机会</a></li>
            <li ms-if="authDocumentaryOffer"><a ms-click="doview2(14)" href="javascript:void(0)">跟单报价</a></li>
            <li ms-if="authContract"><a ms-click="doview2(4)" href="javascript:void(0)">合同订单</a></li>
            <li ms-if="authProductList"><a ms-click="doview2(5)" href="javascript:void(0)">业务明细</a></li>
            <li ms-if="authAccounting"><a ms-click="doview2(6)" href="javascript:void(0)">款项流水</a></li>
            <li ms-if="authCalendar"><a ms-click="doview2(7)" href="javascript:void(0)">日程任务</a></li>
            <li ms-if="authCalls"><a ms-click="doview2(8)" href="javascript:void(0)">来电管理</a></li>
            <li ms-if="authFollowUp"><a ms-click="doview2(9)" href="javascript:void(0)">回访关怀</a></li>
            <li ms-if="authCServices"><a ms-click="doview2(10)" href="javascript:void(0)">客户服务</a></li>
            <li ms-if="authComplaints"><a ms-click="doview2(11)" href="javascript:void(0)">客户投诉</a></li>
            <li ms-if="authCredentials"><a ms-click="doview2(13)" href="javascript:void(0)">客户证件</a></li>
        </ul>
    </div>
    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList">
        <thead>
            <tr class="dobtn">
                <td colspan="12">
                    <a ms-if="ADD" href="javascript:void(0)" ms-click="doadd('')" ms-mouseover="showAddList" ms-mouseout="showAddList" ms-class-doadd2="IsAllCustomer" ms-class-doadd="!IsAllCustomer" ms-html='lang.AddBtn'></a>
                    <a href="javascript:void(0)" ms-click="doBelongTo" class="dobelong" ms-if="TURN">分配归属</a>
                    <a href="javascript:void(0)" ms-click="doShare" class="doshare" ms-if="SHARE">设置共享</a>
                    <a href="javascript:void(0)" ms-click="doPublicSea" class="doputsea" ms-if="SEA" ms-html='lang.PublicSeaBtn'></a>
                    <a href="javascript:void(0)" ms-click="doCenterExpert" class="doexpert" ms-if="EXPERT">放入专管</a>
                    <!--<a href="javascript:void(0)" class="dophone" ms-if="NOTE" ms-html='lang.SMSBtn'></a> <a href="javascript:void(0)" class="doemail" ms-if="EMAIL" ms-html='lang.EMailBtn'></a>
 -->
                    <a href="javascript:void(0)" ms-click="doRemoveAll" class="doalldel" ms-if="DELETE" ms-html='lang.BtachDelBtn'></a>
                    <!--<a href="javascript:void(0)" id="doexecl" class="doexecl" ms-if="EXPORT" title="导出当前数据到Execl" ms-click="exportExcel">导出Excel</a>-->
                    <span class="h2btn" ms-mhover="msdropdown" ms-if="EXPORT">
                        <a href="javascript:void(0)" class="btnexcel" title="导出数据到Execl" ms-click="exportExcel(0)">导出Excel
                                    <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:void(0);" ms-click="exportExcel(1)">导出当前页</a></li>
                            <li><a href="javascript:void(0);" ms-click="exportExcel(0)">导出所有</a></li>
                        </ul>
                    </span>
                    <!-- <span><a href="javascript:void(0)" id="doword" class="doword" ms-if="WORD" title="导出Word">Word</a> <a href="javascript:void(0)" id="dopdf" class="dopdf" ms-if="PDF" title="导出Pdf">PDF</a>
                                </span> -->
                    <a href="javascript:void(0)" ms-click='sendSmsMulti' class="dophone" ms-html="'群发短信'" title="群发短信给客户的默认联系人，没有设置默认联系人的将被忽略。"></a>
                    <div ms-visible="IsShowAddList && ADD" style="position: relative;" ms-mouseover="showAddList" ms-mouseout="showAddList">
                        <ul class="addlist">
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddCustomer')">终端客户</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddCollaborate')">合作伙伴</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddChannel')">渠道代理商</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddSupply')">供应商</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddAdvertising')">媒体资源</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddCompetitor')">竞争对手</a></li>
                            <li><a style="margin-left: 0;" href="javascript:void(0)" ms-click="doadd('/Customer/AddSociall')">社会关系</a></li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr class="head">
                <td width="3%" align="center">
                    <input type="checkbox" ms-duplex-radio='checkAll'>
                </td>
                <td ms-html='lang.ShortName' width="7%" align="center"></td>
                <td ms-html='lang.Name' width="15%" align="center"></td>
                <td ms-html='"状态"' width="6%" align="center"></td>
                <td ms-html='lang.Category' width="6%" align="center"></td>
                <td ms-html='lang.Stage' width="6%" align="center"></td>
                <td ms-html='lang.BelongTo' width="5%" align="center"></td>
                <td width="5%" align="center" ms-click="autosort('AddTime')" class="colsort" title="点击按此列排序">{{lang.AddTime}}
                    <span ms-class-colsortdown="sort=='AddTime' && sortValue==0" ms-class-colsortup="sort=='AddTime' && sortValue==1"></span>
                </td>
                <td width="6%" align="center" ms-click="autosort('LastDocumentary')" class="colsort" title="点击按此列排序">最后跟单
                    <span ms-class-colsortdown="sort=='LastDocumentary' && sortValue==0" ms-class-colsortup="sort=='LastDocumentary' && sortValue==1"></span>
                </td>
                <td width="6%" align="center" ms-click="autosort('LastVisit')" class="colsort" title="点击按此列排序">{{lang.LastVisit}}
                    <span ms-html='' ms-class-colsortdown="sort=='LastVisit' && sortValue==0" ms-class-colsortup="sort=='LastVisit' && sortValue==1"></span>
                </td>
                <td width="6%" align="center" ms-click="autosort('LastSign')" class="colsort" title="点击按此列排序">{{lang.LastSign}}
                    <span ms-html='' ms-class-colsortdown="sort=='LastSign' && sortValue==0" ms-class-colsortup="sort=='LastSign' && sortValue==1"></span>
                </td>
                <td ms-html='lang.Opts' width="3%" align="center"></td>
            </tr>
        </thead>
        <tbody ms-each-c="customers">
            <tr ms-hover='hover'>
                <td align="center">
                    <input type="checkbox" ms-duplex-radio='c.checked' />
                </td>
                <td ms-title='c.ShortName'>
                    <a href="javascript:void(0);" ms-class="{{c.Id==curshowid?'notexpand':'expand'}}" ms-title="c.Id==curshowid?'点击收起':'点击显示更多信息'" ms-click="curshow(c)">&nbsp;</a>
                    {{c.ShortName|truncate(15)}}
                </td>
                <td>
                    <a href='javascript:void(0)' ms-live-click="doview" ms-attr-path="c.DetailUrl.substring(1)+c.Id" ms-title='c.Name' ms-mouseover="loadDmenu(c)" ms-mouseout="showDmenu(false)">{{c.Name|truncate(25)}}
                    </a>
                    <label ms-if="c.ShareToNames.length>0 && c.Owner!=UserId && c.ShareTo.indexOf(UserId)==-1" class="cshare" ms-title="c.OwnerBy+'共享给'+c.ShareToNames"></label>
                    <label ms-if="c.ShareToNames.length>0 && c.Owner==UserId" class="myshare" ms-title="'我共享此客户给：'+c.ShareToNames"></label>
                    <label ms-if="c.ShareToNames.length>0 && c.Owner!=UserId && c.ShareTo.indexOf(UserId)!=-1" class="sharetome" ms-title="c.OwnerBy+'共享给我'"></label>
                    <label ms-if="c.IsOpen" class="cu_open" title="此客户为开放客户，所有人都能查看。"></label>
                </td>
                <td align="center" ms-css-color='c.State==1?"#0A0":""'>{{c.State==1?"正式":"潜在"}}</td>
                <td align="center" ms-title='c.SuperiorCategoryDisplay'>{{c.SuperiorCategoryDisplay|truncate(2,"")}}</td>
                <td align="center" ms-html='c.StageDisplay'></td>
                <td align="center">
                    <a href="javascript:void(0);" ms-text="c.OwnerBy" ms-widget='userCard' ms-data-userid="c.Owner"></a>
                </td>
                <td align="center">{{c.AddTime|truncate(10,'')}}</td>
                <td align="center">{{c.LastDocumentary|truncate(10,'')}}</td>
                <td align="center"><a ms-visible="c.WaitVisit" ms-title="c.WaitVisitMsg" class='waitVisit'></a>
                    {{c.LastVisit|truncate(10,'')}}</td>
                <td align="center">{{c.LastSign|truncate(10,'')}}</td>
                <td align="center">
                    <a href='javascript:void(0)' ms-live-click="doview" ms-attr-path="c.DetailUrl.substring(1)+c.Id" class="doview" title="查看"></a>
                    <a ms-if='c.EDIT' href='javascript:void(0)' ms-live-click="doedit" ms-attr-path="c.EditUrl.substring(1)+c.Id" class="doedit" title="编辑" data-permission="EDIT"></a>
                    <a ms-if='!c.EDIT' href='javascript:void(0)' class='noedit' ms-title='lang.NotEdit'></a>
                    <a ms-if='c.DELETE' href="javascript:void(0)" class="dodel" title="删除" data-permission="DELETE" ms-live-click="doRemove"></a>
                    <a ms-if='!c.DELETE' href='javascript:void(0)' class='nodel' ms-title='lang.NotDelete'></a>
                </td>
            </tr>
            <tr ms-if="c.Id==curshowid">
                <td colspan="12" style="text-align: center;">
                    <table cellspacing="1" cellpadding="0" width="96%" border="0" class="tablecInfo" style="margin: 10px; background: #EAE6E6;">
                        <tr>
                            <td style="width: 80px;">联系人</td>
                            <td style="width: 100px; text-align: left;">{{c.FirstContacts.Name}}</td>
                            <td style="width: 80px;">个人手机</td>
                            <td style="width: 120px; text-align: left;">{{c.FirstContacts.MobileNumber1|mobileFormat|html}}</td>
                            <td style="width: 80px;">个人QQ</td>
                            <td style="width: 120px; text-align: left;">{{c.FirstContacts.QQ}}</td>
                            <td style="width: 80px;">个人Email</td>
                            <td style="width: 80px; text-align: left;"><a ms-if="c.FirstContacts.Email" ms-href="'#/Tools/Email/'+c.FirstContacts.Email+'/send'">{{c.FirstContacts.Email}}</a></td>
                        </tr>
                        <tr>
                            <td>公司电话</td>
                            <td colspan="3" style="text-align: left;">{{c.CompanyTel1|mobileFormat|html}}</td>
                            <td>公司QQ</td>
                            <td style="text-align: left;">{{c.QQ}}
                            </td>
                            <td>公司Email</td>
                            <td style="text-align: left;"><a ms-if="c.Email" ms-href="'#/Tools/Email/'+c.Email+'/send'">{{c.Email}}</a></td>
                        </tr>
                        <tr>
                            <td>公司地址</td>
                            <td colspan="3" style="text-align: left;">{{c.CompanyAddress}}
                                <a class="viewmap" ms-if="c.Lng" href="javascript:void(0)" title="查看地图" ms-click="detailMap"></a>
                            </td>
                            <td>公司网址</td>
                            <td colspan="3" style="text-align: left;">
                                <a ms-if="c.Homepage && c.Homepage!='http://'" ms-href="c.Homepage" target="_blank">{{c.Homepage}}</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
        <tfoot>
            <tr ms-if="grid1.gridmsg">
                <td colspan="12" class="gridmsg">{{grid1.gridmsg|html}}</td>
            </tr>
            <tr style="background-color: #ffffff;">
                <td colspan="12" ms-widget='paging,listPage,listOpts'></td>
            </tr>
        </tfoot>
    </table>
</div>


<noscript id='belongToForm'>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="color: #5C5C5C;">
        <tbody>
            <tr>
                <td ms-html='lang.ChangeBelongTo'></td>
                <td>
                    <input type="text" readonly="readonly" style="width: 320px;" ms-duplex='changeBelongToName' />
                    <button type="button" class="myfbt" ms-click='selectBelongTo()'><i class="iadduser"></i></button>
                </td>
            </tr>
            <tr>
                <td ms-html='lang.ChangeBelongToRemark'></td>
                <td>
                    <textarea rows="5" cols="28" style="height: 50px; width: 78%" ms-duplex='changeBelongToRemark'></textarea></td>
            </tr>
        </tbody>
    </table>
</noscript>

<noscript id='shareToForm'>
    <div class="tabContent2" style="padding-top:0px;">
        <table width="100%" border="0" style="margin: 0px auto;" ms-if="shareCustomers.length>1">
            <tr>
                <td style="width: 70px;">
                    <label>
                        <input type="checkbox" ms-duplex-radio="shareMore" />
                        批量
                    </label>
                </td>
                <td>
                    <span class="tip">勾选批量后，设置一个客户的共享人员，本列表的其余客户也跟着变</span>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" id="grid">
            <tbody>
                <tr class="head" style="background-color: rgb(255, 255, 255);">
                    <td width="25%" align="center" ms-html='lang.Name'></td>
                    <td width="70%" align="center" ms-html='lang.ShareMembers'></td>
                    <td align="center" ms-html='lang.Opts'></td>
                </tr>
                <tr ms-repeat-cs='shareCustomers' ms-hover='hover'>
                    <td height="22" ms-html='cs.Name'></td>
                    <td align="left" ms-html='cs.ShareToNames' style="white-space:normal;"></td>
                    <td align="center">
                        <button type="button" class="myfbt" style='margin-top: 5px;' ms-click='setShare(cs)'><i class="iadduser"></i></button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</noscript>
