<table cellspacing="0" cellpadding="0" border="0" style="width: 800px;">
    <tr>
        <td align="left" style="vertical-align: top;">
            <table cellspacing="0" cellpadding="0" border="0" class="commontable" style="width: 98%;">
                <tbody>
                    <tr>
                        <th style="width: 60px;">号码：</th>
                        <td style="width: 300px;">
                            <div style="position:relative;">
                            <input type="text" ms-duplex="callCenterEntity.CallsMobile" class="tBiggreen" style="width:147px;color:green;" ms-enter="loadNumberInfo" />
                            <!--<input type="button" class="btn" value="查CRM" ms-click="loadNumberInfo" style="margin-bottom:10px;" />-->
                            <input type="button" class="btnsimple" value="查CRM" ms-click="loadNumberInfo" style="margin-bottom:10px;" />
                            <a href="javascript:void(0)" class="zclip acolor" data-copy="mobile" title="复制号码" style="background:none;">复制</a>
                                <a ms-href="'http://www.baidu.com/s?wd=' + callCenterEntity.CallsMobile" title="百度搜索" target="_blank">
                                <img src="/Content/Themes/Base/Images/ico/c_baidu.jpg" style="vertical-align:middle;">
                            </a>
                            
                                </div>
                        </td>
                        <td>来电时间：{{callCenterEntity.CallsTime}}</td>
                    </tr>
                    <tr>
                        <th>姓名：</th>
                        <td>
                            <div style="position:relative;">
                            <input type="text" ms-duplex="callCenterEntity.CallsName" class="tBiggreen" style="width: 101px;color:green;" />
                            <select style="width: 100px;" ms-duplex-text="callCenterEntity.CallsRoleId">
                                <option ms-repeat-item="contactsRols" ms-value="item.Id">{{item.Data}}</option>
                            </select>
                            <a href="javascript:void(0)" class="zclip acolor" data-copy="name" title="复制姓名" style="background:none;">复制</a>
                                </div>
                        </td>
                        <td>
                            联系人性别：
                            <label>
                                <input type="radio" ms-duplex-text="callCenterEntity.CallsSex" value="0" />
                                先生
                            </label>
                            &nbsp;
                            <label>
                                <input type="radio" ms-duplex-text="callCenterEntity.CallsSex" value="1" />
                                女士
                            </label>
                            <div style="position:absolute;top:70px;right:140px;" ms-class="{{callCenterEntity.CallsSex==1?'straCall':'comeCall'}}"></div>
                        </td>
                    </tr>
                    <tr>
                        <th>客户名称：</th>
                        <td>
                            <input type="text" ms-duplex="callCenterEntity.CustomerName" />
                            <button class="myfbt" type="button" ms-click='selectCustomer(true)'><i class="customer"></i></button>
                            <a href="javascript:void(0)" class="acolor" ms-click="gotoview(callCenterEntity.Cid)">查看</a>
                        </td>
                        <td>
                            客户类型：
                            <select ms-duplex-text='customerEntity.Type'>
                                <option ms-repeat-c='cTypes' ms-value="c.val" ms-text='c.label'></option>
                            </select>
                                </td>
                    </tr>
                    <tr>
                        <th>地址：</th>
                        <td>
                            <input type="text" ms-duplex="callCenterEntity.Address" />
                        </td>
                        <td>
                            客户地区：
                            <select ms-duplex-text='customerEntity.CompanyCountryId' class="shortArea">
                                <option ms-repeat-c='area.country' ms-value="c.Id" ms-text='c.Data'></option>
                            </select>
                            <select ms-duplex-text='customerEntity.CompanyProvinceId'' class="shortArea">
                                <option ms-repeat-p='area.province' ms-value="p.Id" ms-text='p.Data'></option>
                            </select>
                            <select ms-duplex-text='customerEntity.CompanyCityId'' class="shortArea">
                                <option ms-repeat-cc='area.city' ms-value="cc.Id" ms-text='cc.Data'></option>
                            </select>
                            <select ms-duplex-text='customerEntity.CompanyAreaId'' class="shortArea">
                                <option ms-repeat-a='area.area' ms-value="a.Id" ms-text='a.Data'></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>QQ：</th>
                        <td>
                            <input type="text" ms-duplex="callCenterEntity.QQ" /></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <div>
                <ul class="tabWarp">
                    <li ms-click="calltabChange('tab1')" ms-class="{{calltab=='tab1'?'hover':'normal'}}" style="width:100px;">快速来电登记</li>
                    <li ms-if="callCenterEntity.Cid" ms-click="calltabChange('tab2')" ms-class="{{calltab=='tab2'?'hover':'normal'}}">客户信息</li>
                    <li ms-if="callCenterEntity.Cid" ms-click="calltabChange('tab3')" ms-class="{{calltab=='tab3'?'hover':'normal'}}">来电记录</li>
                    <li ms-if="callCenterEntity.Cid" ms-click="calltabChange('tab4')" ms-class="{{calltab=='tab4'?'hover':'normal'}}">投诉记录</li>
                    <li ms-if="callCenterEntity.Cid" ms-click="calltabChange('tab5')" ms-class="{{calltab=='tab5'?'hover':'normal'}}">销售机会</li>
                    <li ms-if="callCenterEntity.Cid" ms-click="calltabChange('tab6')" ms-class="{{calltab=='tab6'?'hover':'normal'}}">订单记录</li>
                </ul>
                <div class="tabContent" ms-if="calltab=='tab1'">
                    <table cellspacing="0" cellpadding="0" border="0" class="commontable">
                        <tr>
                            <th style="width: 80px;">来电分类：</th>
                            <td>
                                <label style="padding-right: 10px;" ms-repeat-item="category">
                                    <input type="radio" ms-value="item.Id" ms-duplex-text="callCenterEntity.ClassDicId" />
                                    {{item.Data}}
                                </label>
                            </td>
                        </tr>
                        <tr>
                            <th>来电内容：</th>
                            <td>
                                <table cellspacing="0" cellpadding="0" border="0" >
                                    <tr>
                                        <td>
                                            <textarea rows="2" cols="20" style="height: 121px; width: 450px;" ms-duplex="callCenterEntity.CallsContent"></textarea></td>
                                        <td style="padding-left:10px;">
                                            选择快捷内容：<br />
                                            <select size="3" class="shortcut" style="width: 230px;height:111px;" ms-click="copy" ms-duplex="kuaijieVal" >
                                                <option ms-repeat-item="kuaijie">{{item.Data}}</option>
                                            </select></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <th>处理状态：</th>
                            <td>
                                <label class="labelRight" ms-repeat-item="status">
                                    <input type="radio" name="status" ms-value="item.value" ms-duplex-text="callCenterEntity.Status" />
                                    {{item.key}} 
                                </label>
                            </td>
                        </tr>
                        <tr>
                            <th>转为新客户：</th>
                            <td>
                                <label class="labelRight">
                                    <input type="radio"  value="false" ms-duplex-text="callCenterEntity.IsNewsCustomer" ms-enabled="!callCenterEntity.Cid"  />
                                    否</label>
                                <label>
                                    <input type="radio"  value="true" ms-duplex-text="callCenterEntity.IsNewsCustomer" ms-enabled="!callCenterEntity.Cid"  />
                                    是</label>
                                <!--&nbsp;&nbsp;
                                <span ms-if="callCenterEntity.IsNewsCustomer!='true'" style="margin-left:10px;">
                                是否更新联系人：
                                <label class="labelRight">
                                    <input type="radio" value="false" ms-duplex-text="callCenterEntity.IsUpdateContacts" />
                                    否</label>
                                <label>
                                    <input type="radio" value="true" ms-duplex-text="callCenterEntity.IsUpdateContacts" />
                                    是</label></span>-->
                            </td>
                        </tr>
                        <tr>
                            <th>来电转换为：</th>
                            <td>
                                <label ms-repeat-item="transForm2" class="labelRight">
                                    <input type="radio" name="trans" ms-value="item.value" ms-duplex-text="callCenterEntity.Transform" />
                                    {{item.key}}
                                </label>
                            </td>
                        </tr>
                    </table>
                </div>
                <div ms-if="callCenterEntity.Cid">
                <div class="tabContent" ms-if="calltab=='tab2'">
                    <table border="0" cellspacing="1" cellpadding="0" class="tablecInfo" style="margin: 0 10px; width: 98%;">
                        <tbody>
                            <tr>
                                <td width="90" class="tRed">会员级别：
                                </td>
                                <td width="250">{{customerEntity.MemberGradeDisplay?customerEntity.MemberGradeDisplay:"无"}}
                                </td>
                                <td width="90">客户类型：</td>
                                <td>{{customerEntity.TypeDisplay}}
                                </td>
                            </tr>
                            <tr>
                                <td class="tRed">客户名称：
                                </td>
                                <td>{{customerEntity.Name}}
                                </td>
                                <td>是否黑名单</td>
                                <td ms-class="tRed:customerEntity.IsBlackList">{{customerEntity.IsBlackList?"是":"否"}}
                            </tr>
                            <tr>
                                <td>客户分类：</td>
                                <td>{{customerEntity.CategoryDisplay}}， 
                                                {{customerEntity.State==0?"潜在":"正式"}}-{{customerEntity.StateGradeDisplay}}
                                </td>
                                <td>上级客户：</td>
                                <td>{{customerEntity.ParentName}}
                                </td>
                            </tr>
                            <tr ms-if="customerEntity.SuperiorCategoryId=='10132'">
                                <td>代理区域：</td>
                                <td colspan='3'>{{customerEntity.AuthorizedRegionalsDisplay}}
                                </td>
                            </tr>
                            <tr>
                                <td class="tRed">服务阶段：</td>
                                <td>{{customerEntity.StageDisplay}}
                                </td>
                                <td>客户来源：</td>
                                <td>{{customerEntity.SourceDisplay}}
                                </td>
                            </tr>
                            <tr ms-if='customerEntity.Type==1'>
                                <td ms-html='lang.Sex'></td>
                                <td>{{customerEntity.Sex==0?"男":"女"}}
                                </td>
                                <td>证件</td>
                                <td>{{customerEntity.IdCardTypeDisplay}} &nbsp; {{customerEntity.IdCardNO}}
                                </td>
                            </tr>
                            <tr ms-if='customerEntity.Type==1'>
                                <td ms-html='lang.UnitName'></td>
                                <td>{{customerEntity.Company}}
                                </td>
                                <td ms-html='lang.Department'></td>
                                <td>{{customerEntity.Department}}
                                </td>
                            </tr>
                            <tr>
                                <td>主营行业</td>
                                <td>{{customerEntity.IndustryDisplay}}
                                </td>
                                <td>主营业务</td>
                                <td>{{customerEntity.Profession}}
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="height:10px;"></td>
                            </tr>
                            <tr>
                                <td>签单总额：
                                </td>
                                <td>{{customerEntity.ContractAmount}} 
                                </td>
                                <td>首次跟单：
                                </td>
                                <td>{{customerEntity.FirstDocumentary | truncate(10,'')}}
                                </td>
                            </tr>
                            <tr>
                                <td>最后跟单：
                                </td>
                                <td>{{customerEntity.LastDocumentary | truncate(10,'')}} 
                                </td>
                                <td>首次签约：
                                </td>
                                <td>{{customerEntity.FirstSign | truncate(10,'')}}
                                </td>
                            </tr>
                            <tr>
                                <td>最后签约：
                                </td>
                                <td>{{customerEntity.LastSign | truncate(10,'') | dayspan}} 
                                </td>
                                <td>累计签约：
                                </td>
                                <td>{{customerEntity.SignAllNun}}
                                </td>
                            </tr>
                            <tr>
                                <td>计划下次回访：
                                </td>
                                <td>{{customerEntity.NextVisit | truncate(10,'')}}
                                </td>
                                <td>最后回访：
                                </td>
                                <td>{{customerEntity.LastVisit | truncate(10,'') | dayspan}}
                                </td>
                            </tr>
                            <tr>
                                <td>最后投诉：
                                </td>
                                <td>{{customerEntity.LastComplaint | truncate(10,'')}} 
                                </td>
                                <td>投诉次数：
                                </td>
                                <td>{{customerEntity.ComplaintAllNum | truncate(10,'')}}
                                </td>
                            </tr>
                            <tr>
                                <td>最后回款日期：
                                </td>
                                <td>{{customerEntity.LastPaymentDate | truncate(10,'') | dayspan}} 
                                </td>
                                <td>最后回款金额：
                                </td>
                                <td>{{customerEntity.LastPaymentAmount}}
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="tabContent" ms-if="calltab=='tab3'">
                    <table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList" style="border-bottom:0px;">
                    <thead>
                        <tr class="head">
                            <th align="center" >分类</th>
                            <th align="center" >来电号码</th>
                            <th align="center" >联系人</th>
                            <th align="center" >来电内容</th>
                            <th align="center" >状态</th>
                            <th align="center" >来电时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="dobody" ms-repeat-item="callRelated.callList">
                            <td >{{item.ClassDicId|dicname}}</td>
                            <td >{{item.CallsMobile|mobileFormat|html}}</td>
                            <td >{{item.CallsName}}</td>
                            <td  style="text-align:left" style="padding-left:6px;">
                                <a href="javascript:void(0);" class="showview" ms-click="doview(item.Id)">{{item.CallsContent|truncate(14,"…")}}</a>
                            </td>
                            <td><span ms-class="{{statusIcon(item.Status)}}" ms-title="{{statusTitle(item.Status)}}"></span></td>
                            <td>{{item.CallsTime}}</td>
                        </tr>
                    </tbody>
                    </table>
                </div>
                <div class="tabContent" ms-if="calltab=='tab4'">
                    <table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                        <thead>
                            <tr class="head">
                                <th align="center" style="width: 5%">分类</th>
                                <th align="center" style="width: 15%">投诉主题</th>
                                <th align="center" style="width: 3%">程度</th>
                                <th align="center" style="width: 3%">状态</th>
                                <th align="center" style="width: 5%">投诉时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="dobody" ms-repeat-item="callRelated.compList">
                                <td>{{item.ComplaintsTypeDisplay}}</td>
                                <td style="text-align: left;">
                                    <a href="javascript:void(0)" ms-click="goto('/Services/Complaints/'+item.Id+'/view',true)">{{item.Ttirle|truncate(15,"...")}}</a>

                                </td>
                                <td>{{item.UrgencyLevelDisplay}}</td>
                                <td><span ms-class="{{statusIcon(item.Static)}}" ms-title="{{statusTitle(item.Static)}}"></span></td>
                                <td>{{item.BeginTime}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="tabContent" ms-if="calltab=='tab5'">
                    <table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                        <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                            <td width="30%" align="center">
                                机会主题
                            </td>  
                            <td width="10%" align="center">
                                客户来源
                            </td>
                            <td width="6%" align="center">
                                状态
                            </td>
                            <td width="6%" align="center">
                                跟单人
                            </td>
                            <td width="8%" align="center">
                                发现时间
                            </td>
                            <td width="8%" align="center">
                                预签单日期
                            </td> 
                        </tr> 
                        <tr ms-repeat-item="callRelated.salesoppList" style="background-color: rgb(255, 255, 255);">
                            <td align="left">
                                <a href="javascript:void(0)" ms-click="goto('/Market/SalesOpportunities/'+item.Id+'/view',true)">{{item.Title}}</a>
                            </td>
                            <td align="center">
                                {{item.CustomerSourceDisplay}}
                            </td> 
                             <td align="center">
                                {{item.StateDisplay}}
                            </td>
                             <td align="center">
                                {{item.OpportunitiesFollow.FullName}}
                            </td>
                            <td align="center">
                                {{item.DiscoverDate}}
                            </td>
                            <td align="center"> 
                                {{item.ExpectSigningDate | truncate(10,'')}}
                            </td> 
                        </tr> 
                </table> 
                </div>
                <div class="tabContent" ms-if="calltab=='tab6'">
                    <table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                        <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                            <td width="10%" align="center">编号
                            </td>
                            <td width="30%" align="center">合同名称
                            </td>
                            <td width="10%" align="center">类型
                            </td>
                            <td width="10%" align="center">状态
                            </td>
                            <td width="10%" align="center">金额
                            </td>
                            <td width="5%" align="center">签约人
                            </td>
                            <td width="10%" align="center">签约时间
                            </td>
                        </tr>
                        <tr ms-repeat-item="callRelated.contractList" style="background-color: rgb(255, 255, 255);">
                            <td align="center">{{item.ContractNum}}
                            </td>
                            <td align="left">
                                <a href="javascript:void(0)" ms-click="goto('/Market/Contract/'+ item.Id +'/view',true)">{{item.ContractName}}</a>
                            </td>
                            <td align="center">{{item.ContractTypeDisplay}}
                            </td>
                            <td align="center">{{item.StateDisplay}}
                            </td>
                            <td align="center">{{item.Amount}}
                            </td>
                            <td align="left">{{item.MySignPersion.FullName}}
                            </td>
                            <td align="center">{{item.SignAContractDate | truncate(10,'')}}
                            </td>
                        </tr>
                    </table>
                </div>
                    </div>
            </div>
        </td>
    </tr>
</table>
