<div ms-css-width="viewWidth">
    <div>
        <ul class="tabWarp">
            <li ms-class-hover="tab=='tab1'" ms-class-normal="tab!='tab1'" val="tab1" ms-click="tabChange">基本信息</li>
            <li ms-class-hover="tab=='tab2'" ms-class-normal="tab!='tab2'" val="tab2" ms-click="tabChange">报价明细</li>
            <!--   <li ms-class-hover="tab=='tab3'" ms-class-normal="tab!='tab3'" val="tab3" ms-click="tabChange">出库明细</li>-->
        </ul>
    </div>
    <div class="tabContent" ms-visible="tab=='tab1'">
        <table width="99%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D2D2D2"
            class="tablecInfo" ms-controller="marketingdocumentaryoffer" style="margin-left: 5px;">
            <tr>
                <td>主&nbsp;&nbsp;&nbsp;&nbsp;题：
                </td>
                <td colspan="3">{{entity.Title}}
                </td>
            </tr>
            <tr ms-if="grid1.showCustomer">
                <td>客户：
                </td>
                <td colspan="3">
                    <a href="javascript:void(0)" ms-click="gotoview(entity.Customer)">{{entity.CustomerDisplay}}</a> 
                </td>
            </tr>
            <tr>
                <td width="100">销售机会：
                </td>
                <td width="200">
                    <a ms-click="doviewSales" ms-attr-val="entity.SalesOpportunities" href="javascript:void(0)" title="查看销售机会">{{entity.SalesOpportunitiesDisplay}}</a>
                </td>
                <td width="100">客户联系人：
                </td>
                <td>
                    {{entity.CustomerContactDisplay}}
                    <a ms-if="entity.CustomerContact>0" href="javascript:void(0)" class="contactsCard" ms-widget="contactsCard" ms-data-id="entity.CustomerContact"></a>
                </td>
            </tr>
            <tr>
                <td>跟单描述：
                </td>
                <td colspan="3" style="height: 100px;" valign="top">
                    <div style="max-height:400px;overflow:auto;">{{entity.CustomerDemand|html}}</div>
                </td>
            </tr>
            <tr>
                <td>报价相关附件：
                </td>
                <td>
                    <!--<a ms-if="entity.Files" ms-href="entity.Files">下载附件</a>-->
                    <a ms-if="entity.Files" ms-href="/Upload/Down?path={{entity.Files}}" target="_blank">下载附件</a>
                </td>
                <td>报价有效期至：</td>
                <td>{{entity.ValidityDate}}
                </td>
            </tr>
            <tr>
                <td>跟单报价人：
                </td>
                <td>{{entity.DocumentaryEmployeeDisplay}}
                </td>
                <td>跟单报价时间：
                </td>
                <td>{{entity.OfferDate}}
                </td>
            </tr>
        </table>
        <div style="width: 100%; margin-top: 10px;">
            <span style="width:2px;background:#09c6f1;height:15px;display:inline-block; margin-left: 10px;vertical-align:middle;"></span>
            <span style="font-size: 14px; font-weight: bold;vertical-align:middle;">跟单点评</span>
            <a ms-if="show" href="javascript:void(0);" ms-click="commentAdd(entity,0)" style="margin-right: 10px;float:right; font-size: 14px;vertical-align:middle;  font-weight: bold;" class="acolor">+新增点评</a>
        </div>
        <div style="width: 98.5%; height: 230px; margin-top: 5px; border: 1px solid #D2D2D2; overflow-y: scroll; margin-left: 5px;">
            <div style="width: 100%; margin-top: 10px; text-align: center;" ms-if="entityDetailList.size()==0">
                <span style="font-size: 18px;">暂无点评！</span>
            </div>
            <div style="width: 100%; margin-top: 10px;" ms-repeat-item="entityDetailList">
                <div style="width: 100%; margin: 0 auto; overflow: auto; margin-bottom: 5px; margin-top: 5px;">
                    <div class="lingdao_pic" style="margin-left: 5px;">
                        <img alt="用户头像" width="70px" height="70px" style="width: 70px; height: 70px;" ms-src="item.Picture">
                        <p style="text-align: center; margin: 0; padding: 0;">
                            <a style="color: #0064d3; font-size: 9pt;" href="javascript:void(0)" ms-widget='userCard' ms-data-userid="item.AddEmpId">{{item.AddByName}}</a>
                        </p>
                    </div>
                    <div class="comment">
                        <p style="background: #f2f2f2; height: 30px; line-height: 30px; color: #9c9a9c; margin: 0; padding: 0 10px;">
                            <span>
                                {{item.AddByName}}({{item.Position}})，点评于{{item.CommentDate}}&nbsp;|&nbsp;
                                <a href="javascript:void(0);" title="编辑" ms-if="item.AddEmpId==uid" ms-click="commentEdit(item)" style="color: #016b96;">编辑</a>
                                <span title="只能编辑自己的点评" ms-if="item.AddEmpId!=uid">编辑</span>
                            </span>
                        </p>
                        <p style="padding: 10px;  color: #5C5C5C; min-height: 40px;">
                            {{item.Comments|areaText|html}}
                        </p>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="tabContent" ms-visible="tab=='tab2'">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList" >
            <tr class="minhead" align="center">
                <td width="2%">序号
                </td>
                <td width="40%">产品名称
                </td>
                <td width="20%">规格/型号
                </td>
                <td width="15%">单价
                </td>
                <td width="10%">数量
                </td>
                <td width="13%">金额
                </td>
            </tr>
            <tr ms-repeat-item="documentaryofferproductslist" align="center" style="background-color: rgb(255, 255, 255);">
                <td style="text-align: center;">{{($index+1)}}</td>
                <td>{{item.ProductName}} </td>
                <td>{{item.Standard}} </td>
                <td>{{item.Price}} </td>
                <td>{{item.Num}}</td>
                <td>{{item.Money}}</td>
            </tr>
            <tr style="background: #fff;">
                <td colspan="5">
                    <table width="100%" border="0" cellspacing="1" cellpadding="0">
                        <tr style="background: #fff;">
                            <td rowspan="2" valign="top">&nbsp;&nbsp;报价类型：{{entity.OfferTypeDisplay}}</td>
                            <td style="text-align: right; line-height: 22px; height: 22px;">(小计{{entity.OfferTotal}} x 税率{{entity.TaxRate}}%
                                             = 税额{{entity.TaxAmt}}) + 小计</td>
                        </tr>
                        <tr style="background: #fff;">
                            <td style="text-align: right; line-height: 22px; height: 22px;">=&nbsp;合计</td>
                        </tr>
                    </table>
                </td>
                <td colspan="1">
                    <table border="0" cellspacing="1" cellpadding="0">
                        <tr style="background: #fff;">
                            <td style="padding-left: 38px; line-height: 22px; height: 22px;">{{entity.OfferTotal}}</td>
                        </tr>
                        <tr style="background: #fff;">
                            <td style="padding-left: 38px; line-height: 22px; height: 22px; font-size: 14px; color: #f00;">{{entity.TotalAmt}}</td>
                        </tr>
                    </table>
                </td>

            </tr>
            <tr ms-visible="entity.HasPaySendType" style="background: #fff;">
                <td colspan="6">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
                        <tbody>
                            <tr>
                                <th width="90">1.付款方式：
                                </th>
                                <td width="360">{{entity.PayTypeDisplay}}
                                </td>
                                <th width="90">结算方式：
                                </th>
                                <td width="300">{{entity.BalanceTypeDisplay}}
                                </td>
                            </tr>
                            <tr>
                                <th>付款说明：
                                </th>
                                <td>{{entity.PayToRemark}}
                                </td>
                                <th>要求票据：
                                </th>
                                <td>{{entity.NoteTypeDisplay}}
                                </td>
                            </tr>
                            <tr>
                                <th>2.发货方式：
                                </th>
                                <td>{{entity.ConsignmentTypeDisplay}}
                                </td>
                                <th>交货日期：
                                </th>
                                <td>{{entity.DeliveryDate|truncate(10,'')}}
                                </td>
                            </tr>
                            <tr>
                                <th>收货人：
                                </th>
                                <td>{{entity.ConsigneeDisplay}} 
                                </td>
                                <th>运费承担：
                                </th>
                                <td colspan="3">{{entity.FreightBear}}
                                </td>
                            </tr>
                            <tr>
                                <th>收货电话：
                                </th>
                                <td>{{entity.ConsigneePhone}} 
                                </td>
                                <th>收货地址：</th>
                                <td>{{entity.ConsigneeAddress}} 
                                </td>
                            </tr>
                            <tr>
                                <th>3.其他说明：
                                </th>
                                <td colspan="3">{{entity.PayRemark}}
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</div>
