<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>
        <!--<li ms-class-hover="tab=='tab4'" ms-class-normal="tab!='tab4'" val="tab4" ms-click="tabChange">应收应付</li>-->
    </ul>
</div>
<div class="tabContent" ms-visible="tab=='tab1'">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
        <tr>
            <th width="90">{{lang.BelongToCampaign}}：
            </th>
            <td width="380">
                <input type="hidden" ms-duplex="entity.MarketingCampaign" />
                <input type="text" ms-duplex="entity.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;display:none;" 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: #ffffff;">
                            <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: #ffffff; 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>
            <th width="100">{{lang.BelongToActivity}}：
            </th>
            <td>
                <input type="hidden" ms-duplex="entity.MarketActivity" />
                <input type="text" ms-duplex="entity.MarketActivityDisplay" readonly="readonly">
                <button type="button" class="myfbt" ms-click="selectActivity">
                    <i class="customer"></i>
                </button>
                <div ms-visible="activityPanel" class="dropdownPanel" style="width: 610px; position: absolute; right: 50px;display:none;" 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></span>
                                <button type="button" ms-click="clearActivityValue">清空</button></span>
                            </h2>
                        </div>
                        <div style="height: 200px; overflow: auto; background-color: #ffffff;">
                            <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: #ffffff; 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>
            <th>{{lang.BelongToSalesOpportunities}}：
            </th>
            <td>
                <input type="hidden" ms-duplex="entity.SalesOpportunities" />
                <input type="text" ms-duplex="entity.SalesOpportunitiesDisplay" readonly="readonly">
                <button type="button" class="myfbt" ms-click="selectSalesOpportunities">
                    <i class="customer"></i>
                </button>
                <div ms-visible="salesOpportunitiesPanel" class="dropdownPanel" style="width: 610px; position: absolute;display:none;" ms-mousedown="mousedownstop">
                    <div>
                        <div class="boxTitlenob" style="margin-left: 0;">
                            <h2>
                                <span class="rseachbox">
                                    <input style="margin-bottom: 0px;" ms-duplex="salesOpportunitiesKey" type="text">
                                    <button type="button" class="inputbt" ms-click="searchSalesOpportunities">
                                    </button>
                                </span>
                                <span style="float: right">
                                    <button type="button" ms-click="closeSalesOpportunitiesPanel">{{lang.Close}}</button>
                                    <button type="button" ms-click="clearSalesOpportunitiesValue">清空</button>
                                </span>
                            </h2>
                        </div>
                        <div style="height: 200px; overflow: auto; background-color: #ffffff;">
                            <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                                <thead>
                                    <tr class="head">
                                        <td width="20%" align="center">{{lang.OpportunitiesTheme}}</td>
                                        <td width="8%" align="center">{{lang.CustomerSource}}</td>
                                        <td width="20%" align="center">{{lang.Customer}}</td>
                                        <td width="15%" align="center">{{lang.DiscoverDate}}</td>
                                        <td width="7%" align="center">{{lang.OpportunitiesState}}</td>
                                    </tr>
                                </thead>
                                <tbody ms-each-item="salesOpportunitiesList">
                                    <tr style="background-color: #ffffff; cursor: pointer;" ms-live-click="clickSalesOpportunities" ms-attr-key="item.Id" ms-attr-alt="item.Title" title="点击选择">
                                        <td align="left">{{item.Title}}
                                        </td>
                                        <td align="center">{{item.CustomerSourceDisplay}}
                                        </td>
                                        <td align="center">{{item.CustomerDisplay}}
                                        </td>
                                        <td align="center">{{item.DiscoverDate | truncate(10,'')}}
                                        </td>
                                        <td align="center">{{item.StateDisplay}}
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </td>
            <th>{{lang.BelongToDocumentaryOffer}}：
            </th>
            <td>
                <input type="hidden" ms-duplex="entity.DocumentaryOffer" />
                <input type="text" ms-duplex="entity.DocumentaryOfferDisplay" readonly="readonly">
                <button type="button" class="myfbt" ms-click="selectDocumentaryOffer">
                    <i class="customer"></i>
                </button>
                <div ms-visible="documentaryOfferPanel" class="dropdownPanel" style="width: 610px; position: absolute; right: 50px;display:none;" ms-mousedown="mousedownstop">
                    <div>
                        <div class="boxTitlenob" style="margin-left: 0;">
                            <h2>
                                <span class="rseachbox">
                                    <input style="margin-bottom: 0px;" ms-duplex="documentaryOfferKey" type="text">
                                    <button type="button" class="inputbt" ms-click="searchDocumentaryOffer">
                                    </button>
                                </span>
                                <span style="float: right">
                                    <button type="button" ms-click="closeDocumentaryOfferPanel">{{lang.Close}}</button>
                                    <button type="button" ms-click="clearSalesOpportunitiesValue">清空</button>
                                </span>
                            </h2>
                        </div>
                        <div style="height: 200px; overflow: auto; background-color: #ffffff;">
                            <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                                <thead>
                                    <tr class="head">
                                        <td width="20%" align="center">{{lang.Theme}}</td>
                                        <td width="20%" align="center">{{lang.AboutCustomer}}</td>
                                        <td width="10%" align="center">{{lang.SalesOpportunities}}</td>
                                        <td width="13%" align="center">{{lang.Documentaryperson}}</td>
                                        <td width="7%" align="center">{{lang.OfferDate}}</td>

                                    </tr>
                                </thead>
                                <tbody ms-each-item="documentaryOfferList">
                                    <tr style="background-color: #ffffff; cursor: pointer;" ms-live-click="clickDocumentaryOffer" ms-attr-key="item.Id" ms-attr-alt="item.Title" title="点击选择">
                                        <td align="left">{{item.Title}}
                                        </td>
                                        <td align="center">{{item.CustomerDisplay}}
                                        </td>
                                        <td align="center">{{item.SalesOpportunitiesDisplay}}
                                        </td>
                                        <td align="center">{{item.DocumentaryEmployeeDisplay}}
                                        </td>
                                        <td align="center">{{item.OfferDate | truncate(10,'')}}
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <div class="border bottom10" style="padding-top:10px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
                    <tr>
                        <th style="width: 90px;">{{lang.ContractName}}：
                        </th>
                        <td style="width: 380px;">
                            <input type="text" ms-duplex="entity.ContractName" ms-attr-placeholder="lang.InputContract"/>
                            <span class="must">*</span>
                        </td>
                        <th style="width: 100px;">合同编号：
                        </th>
                        <td>
                            <select ms-duplex="entity.ContractType" style="width: 100px;" ms-each-item="contracttypedata">
                                <option ms-value="item.Id">{{item.Data}}</option>
                            </select>
                            <input type="text" ms-duplex="entity.ContractNum" style="width: 100px;" />
                            <span class="must">*</span>
                            <a href="javascript:void(0)" title="点击获取新的合同编号" ms-click="getAutoCode()" class="acolor">刷新</a>
                        </td>
                    </tr>
                    <tr>
                        <th>{{lang.BelongToEmployee}}：</th>
                        <td>
                            <input type="text" ms-duplex="entity.BelongToDisplay" readonly="readonly" style="width: 80px;" />
                            <button type="button" class="myfbt" ms-click="selectBelongTo()"><i class="iadduser"></i></button>
                        </td>
                        <th>客户：</th>
                        <td>
                            <div ms-if="!showOnlyList">
                                <input type="hidden" ms-duplex="entity.Customer" readonly="readonly">
                                <input type="text" ms-duplex="entity.CustomerDisplay" readonly="readonly">
                                <button class="myfbt" type="button" ms-click='selectCustomer()'>
                                    <i class="customer"></i>
                                </button>
                                <span class="must">*</span>
                            </div>
                            <div ms-if="showOnlyList" class="subtitle">{{entity.CustomerDisplay}}</div>
                        </td>
                    </tr>
                    <tr>
                        <th>{{lang.MySignPersion}}：
                        </th>
                        <td>
                            <input type="hidden" ms-duplex="entity.MySignPersion" />
                            <input type="text" ms-duplex="entity.MySignPersionDisplay" readonly="readonly" style="width: 80px;" />
                            <button type="button" class="myfbt" ms-click="selectSignpersion()"><i class="iadduser"></i></button>
                        </td>
                        <th>{{lang.CustomerSignPersion}}：
                        </th>
                        <td>
                            <input type="hidden" ms-duplex="entity.CustomerSign">
                            <input type="text" ms-duplex="entity.CustomerSignDisplay" style="width: 100px;">
                            <select style="width: 100px;" ms-change="contactChange">
                                <option value="">选择联系人</option>
                                <option ms-repeat-con="CustomerContactData" ms-value="con.Id">{{con.Name}}</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>{{lang.SignDateTime}}：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.SignAContractDate" style="width: 80px;" ms-widget="date,signacontractdateid,signacontractdateOpts" />
                            <span class="must">*</span>
                        </td>
                        <th>{{lang.ContractLitmid}}：
                        </th>
                        <td>
                            <ul>
                                <li style="float: left;">
                                    <input type="text" ms-duplex="entity.StartDate" style="width: 84px" ms-widget="date,contractstartdateid,contractstardateOpts" />
                                    <span style="margin-left: -14px;">至</span>
                                    <input type="text" ms-duplex="entity.EndDate" style="width: 83px" ms-widget="date,contractenddateid,contractenddateOpts" />
                                </li>
                                <li style="float: left;">
                                    <div><span class="must" style="margin-left: -5px;">*</span></div>
                                    <div>
                                        <a ms-repeat-t="timeSpans" ms-click="computeEndDate(t)" href="javascript:void(0)" class="acolor" style="margin-right:5px;">{{t.label}}</a>
                                    </div>
                                </li>
                            </ul>
                        </td>
                    </tr>
                </table>
                </div>
            </td>
        </tr>
        <tr>
            <th>{{lang.CurrentStage}}：
            </th>
            <td>
                <select ms-duplex="entity.CurrentStage" style="width: 93px;" ms-each-item="contractstagedata">
                    <option ms-value="item.Id">{{item.Data}}</option>
                </select>
            </td>
            <th>合同总金额：</th>
            <td>
                <div class="input-append">
                    <input type="text" ms-duplex="entity.Amount" ms-keyup="mathAllResult" style="width: 60px" />
                    <span class="add-on">元</span>
                </div>
                <span class="must">*</span>
                <span ms-if="entity.Id && entity.ReturnedMoney">{{lang.ReturnedMoney}}：{{entity.ReturnedMoney}}{{lang.Yuan}}
                </span>
                <span class="helptip" title="已回款金额为系统从财务收款中自动获取数值。">&nbsp;</span>
            </td>
        </tr>
        <tr>
            <th>{{lang.ContractState}}：
            </th>
            <td>
                <select ms-duplex="entity.State" style="width: 93px;" ms-each-item="contractstatedata">
                    <option ms-value="item.Id">{{item.Data}}</option>
                </select>
            </td>
            <th>毛利估算：
            </th>
            <td>
                <div class="input-append">
                    <input type="text" ms-duplex="entity.GrossProfit" style="width: 60px" />
                    <span class="add-on bindCurrency">{{lang.Yuan}}</span>
                </div>
            </td>
        </tr>
        <tr>
            <th valign="top">{{lang.ContractRemark}}：
            </th>
            <td colspan="3">
                <input type="text" id="txtRemark" ms-muplex="entity.Remark" />
            </td>
        </tr>
        <tr>
            <th style="vertical-align:top;">附件：
            </th>
            <td colspan="3" height="60" style="vertical-align: top;">
                <!--<input type="text" readonly="readonly" ms-duplex="entity.Files" />-->
                <span ms-repeat-file="entity.FileList" ms-class-1="txtdeleted:!file.Id">{{file.FileName}}<a ms-click="delFile($index)" href="javascript:void(0)" class="dodel" title="移除附件"></a> </span>
                <div>
                    <button type="button" class="btnsimple" ms-click="uploadFiles">
                        添加附件
                    </button>
                </div>
            </td>
        </tr>
        <tr>
            <th>录入人：</th>
            <td>{{entity.AddBy.FullName}}</td>
            <th>&nbsp;</th>
            <td colspan="2">
                <div style="float:right;">
                    录入时间：<input ms-duplex="entity.AddTime" ms-widget="date" style="width: 135px;" />
                </div>
                
            </td>
        </tr>
    </table>
</div>
<div class="tabContent" ms-visible="tab=='tab2'">
    <table style="width: 100%; margin: 0 auto;" border="0" cellspacing="1" cellpadding="0" class="tableList hasOfferPanel">
        <tr class="minhead" align="center">
            <td width="18%">{{lang.ProductOrServerName}}
            </td>
            <td width="10%">{{lang.ProductAlias}}
            </td>
            <td width="8%">{{lang.Brand}}
            </td>
            <td width="10%">规格/型号/摘要
            </td>
            <td width="6%">产品单价
            </td>
            <td width="6%">{{lang.Price}}
            </td>
            <td width="6%">{{lang.Quantity}}
            </td>
            <td width="6%">成交金额
            </td>
            <td width="6%" ms-visible="PRODUCTSTOCKTPRICE">提成基准价
            </td>
            <td width="6%" ms-visible="PRODUCTSTOCKTPRICE">提成金额
            </td>
            <td width="3%" align="center">{{lang.Operate}}
            </td>
        </tr>
        <tbody ms-each-item="contractdetailslist">
            <tr align="center" style="background-color: #ffffff;" ms-click="onSetIndex">
                <td>
                    <input type="text" ms-duplex="item.ProductName" readonly="readonly" style="width: 120px;" />
                    <input type="hidden" ms-duplex="item.Product" />
                    <button type="button" ms-attr-index="$index" class="myfbt" ms-click="onSelectProuct"><i class="customer"></i></button>
                </td>
                <td>
                    <input type="text" ms-duplex="item.ProductAlias" style="width: 100px;" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.BrandName" style="width: 70px;" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.Standard" style="width: 100px;" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.StandardPrice" style="width: 50px;" readonly="true" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.Price" style="width: 50px;" data-id="Price" ms-keyup="onSumRowMoney(item)" ms-attr-index="$index" ms-class-1="redbg:item.Price<item.LowestPrice" />
                </td>
                <td>
                    <div class="input-append">
                        <input type="text" ms-duplex="item.Num" style="width: 30px;" ms-keyup="onSumRowMoney(item)" ms-attr-index="$index" />
                        <span class="add-on">{{item.UnitsDisplay}}</span>
                    </div>
                </td>
                <td>
                    <input type="text" ms-duplex="item.Money" ms-keyup="onSumCost" style="width: 60px;" />
                </td>
                <td ms-visible="PRODUCTSTOCKTPRICE">
                    <input ms-keyup="computeRoyalty" ms-duplex="item.RoyaltyPrice" type="text" style="width: 50px;" />
                </td>
                <td ms-visible="PRODUCTSTOCKTPRICE">
                    <input ms-duplex="item.RoyaltyMoney" ms-attr-title="royaltyDsc(item)" type="text" style="width: 50px;" />
                </td>
                <td align="center">
                    <a href="javascript:void(0)" class="dodel" ms-attr-index="$index" ms-click="onRelevanceDel('contractdetails')"></a>
                </td>
            </tr>
        </tbody>
        <tr style="background-color: #ffffff;">
            <td colspan="7" style="background-color: #ffffff;">
                <table width="100%" border="0" cellspacing="1" cellpadding="0">
                    <tr style="background: #ffffff;">
                        <td valign="top"><a ms-click="onRelevanceAdd('contractdetails')" href="javascript:void(0);">+&nbsp;新增一行</a></td>
                        <td style="text-align: right;">小计</td>
                    </tr>
                    <tr style="background: #ffffff;">
                        <td>&nbsp;</td>
                        <td style="text-align: right;">上述价格&nbsp;&nbsp;
                                               <label>
                                                   <input type="checkbox" ms-duplex-radio="entity.ContainsTax" />另计税金</label><span ms-visible="entity.ContainsTax">&nbsp;&nbsp;税率</span>
                        </td>
                    </tr>
                    <tr ms-visible="entity.ContainsTax" style="background: #ffffff;">
                        <td>&nbsp;</td>
                        <td style="text-align: right;">+税额</td>
                    </tr>
                    <tr style="background: #ffffff;">
                        <td>&nbsp;</td>
                        <td style="text-align: right;">-优惠</td>
                    </tr>
                    <tr style="background: #ffffff;">
                        <td>业务说明：<input type="text" ms-duplex="entity.ProductRemark" placeholder="对订购业务的补充说明" style="width: 400px;" /></td>
                        <td style="text-align: right;">合同总金额</td>
                    </tr>
                </table>
            </td>
            <td colspan="4" style="background-color: #ffffff;">
                <table width="100%" border="0" cellspacing="1" cellpadding="0">
                    <tr>
                        <td>
                            <input type="text" ms-duplex="entity.CountAmount" style="width: 80px; margin: 0; padding: 0 3px;" readonly="readonly" />
                            <span style="display: inline-block; width: auto; height: 14px; padding: 3px; font-weight: normal; line-height: 12px; text-align: center; text-shadow: 0 1px 0 white; background-color: #EEE; border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; margin: 0px 0 0 -4px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;">元</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span ms-visible="entity.ContainsTax">
                                <input type="text" ms-duplex="entity.TaxRate" ms-blur="onSumTax" style="width: 80px; margin: 0; padding: 0 3px;" />
                                <span style="display: inline-block; width: auto; height: 14px; padding: 3px; font-weight: normal; line-height: 12px; text-align: center; text-shadow: 0 1px 0 white; background-color: #EEE; border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; margin: 0px 0 0 -4px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;">%</span>
                            </span>
                        </td>
                    </tr>
                    <tr ms-visible="entity.ContainsTax">
                        <td>
                            <input type="text" ms-duplex="entity.FillUpTax" style="width: 80px; margin: 0; padding: 0 3px;" readonly="readonly" />
                            <span style="display: inline-block; width: auto; height: 14px; padding: 3px; font-weight: normal; line-height: 12px; text-align: center; text-shadow: 0 1px 0 white; background-color: #EEE; border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; margin: 0px 0 0 -4px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;">元</span>

                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="text" ms-duplex="entity.FavourableAmount" ms-blur="onSumTax" style="width: 80px; margin: 0; padding: 0 3px;" />
                            <span style="display: inline-block; width: auto; height: 14px; padding: 3px; font-weight: normal; line-height: 12px; text-align: center; text-shadow: 0 1px 0 white; background-color: #EEE; border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; margin: 0px 0 0 -4px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;">元</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="text" ms-duplex="entity.Amount" style="width: 80px; margin: 0; padding: 0 3px;" />
                            <span style="display: inline-block; width: auto; height: 14px; padding: 3px; font-weight: normal; line-height: 12px; text-align: center; text-shadow: 0 1px 0 white; background-color: #EEE; border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; margin: 0px 0 0 -4px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;">元</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<div class="tabContent" ms-visible="tab=='tab3'">
    <table style="width: 100%; margin: 0 auto;" border="0" cellspacing="1" cellpadding="0" class="tableList hasOfferPanel">
        <tr class="minhead" align="center">
            <td width="5%">计划付款期次
            </td>
            <td width="15%">{{lang.ItemCostName}}
            </td>
            <td width="8%">{{lang.Amount}}
            </td>
            <td width="5%">{{lang.Percents}}
            </td>
            <!--<td width="8%">{{lang.PlanReturnedMoneyDate}}
            </td>
            <td width="7%">{{lang.ReturnedMonerState}}
            </td>-->
            <td width="15%">说明
            </td>
            <td width="5%" align="center">{{lang.Operate}}
            </td>
        </tr>
        <tr align="center" ms-repeat-item="planofpaylist" ms-click="onSetIndex">
            <td>
                <div class="input-append">
                    <input type="text" ms-duplex="item.Num" style="width: 15px" />
                    <span class="add-on">{{lang.Ci}}</span>
                </div>
            </td>
            <td>
                <input type="text" ms-duplex="item.Item" style="width: 90%" />
            </td>
            <td>
                <div class="input-append">
                    <input type="text" ms-duplex="item.Money" style="width: 90px;" ms-keyup="doMathRate(item)" />
                    <span class="add-on bindCurrency">{{lang.Yuan}}</span>
                </div>
            </td>
            <td>
                <div class="input-append">
                    <input type="text" ms-duplex="item.Percents" style="width: 25px;" ms-keyup="doMathResult(item)" />
                    <span class="add-on">%</span>
                </div>
            </td>
            <!--<td>
                <input type="text" ms-duplex="item.ReturnedDate" style="width: 80px;" readonly="readonly" ms-widget="date,returneddateid,retrunmoneydateOpts" />
            </td>
            <td>
                <select ms-duplex="item.ReturnedState" ms-each-dict="returnedstatedata" style="width: 120px;" disabled="disabled">
                    <option ms-value="dict.Id">{{dict.Data}}</option>
                </select>
            </td>-->
            <td>
                <input type="text" ms-duplex="item.Remark" style="width: 120px;" />
            </td>
            <td align="center">
                <a ms-if="$index==0" href="javascript:void(0)" class="nodel"></a>
                <a ms-if="$index>0" href="javascript:void(0)" class="dodel" ms-attr-index="$index" ms-click="onRelevanceDel('planofpay')"></a>
            </td>
        </tr>
        <tr style="background: #ffffff;">
            <td colspan="6">
                <a ms-click="onRelevanceAdd('planofpay')" href="javascript:void(0);">&nbsp;+&nbsp;新增一行</a>
                <div class="padding10">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
                    <tr>
                        <th>补充说明：</th>
                        <td colspan="5">
                            <input type="text" placeholder="对付款期次的补充" ms-duplex="entity.PayRemark1" class="bindDefault" ms-default="lang.OtherRemarkDescribe" style="width: 91%;" />
                        </td>
                    </tr>
                    <tr>
                        <th style="width:90px;">
                            {{lang.CustomOpenBrank}}：
                        </th>
                        <td style="width:130px;">
                            <select ms-duplex="entity.CustomerBankId" style="width: 120px;">
                                <option value="">请选择</option>
                                <option ms-repeat-item="bankdata" ms-value="item.Id" ms-text="item.Data"></option>
                            </select>
                        </td>
                        <th style="width:90px;">{{lang.CustomerBankName}}： </th>
                        <td style="width:210px;">
                            <input type="text" ms-duplex="entity.CustomerBankName" style="width: 200px" />
                        </td>
                        <th style="width:90px;">{{lang.CustomerBankAccount}}： </th>
                        <td>
                            <input type="text" ms-duplex="entity.CustomerAccount" style="width: 200px" />
                        </td>
                    </tr>
                </table>
                </div>
            </td>
        </tr>
    </table>
    <div class="border padding10 top10">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
        <tbody>
            <tr>
                <th width="90">1.付款方式：
                </th>
                <td width="380">
                    <select style="width: 110px;" ms-duplex="entity.PayType">
                        <option value="">请选择</option>
                        <option ms-repeat-subitem="paytpyedata" ms-value="subitem.Id">{{subitem.Data}}</option>
                    </select>
                </td>
                <th width="90">结算方式：
                </th>
                <td>
                    <select style="width: 110px;" ms-duplex="entity.BalanceType">
                        <option value="">请选择</option>
                        <option ms-repeat-subitem="balancetypedata" ms-value="subitem.Id">{{subitem.Data}}</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>付款说明：
                </th>
                <td>
                    <input type="text" ms-duplex="entity.PayRemark" placeholder="对付款方式的补充说明" style="width: 300px;">
                </td>
                <th>开票类型：
                </th>
                <td>
                    <select style="width: 110px;" ms-duplex="entity.NoteType">
                        <option value="">请选择</option>
                        <option ms-repeat-subitem="billtypedata" ms-value="subitem.Id">{{subitem.Data}}</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th>2.发货方式：
                </th>
                <td>
                    <select style="width: 110px;" ms-duplex="entity.ConsignmentType">
                        <option value="">请选择</option>
                        <option ms-repeat-subitem="consignmenttype" ms-value="subitem.Id">{{subitem.Data}}</option>
                    </select>
                </td>
                <th>交货日期：
                </th>
                <td>
                    <input type="text" ms-duplex="entity.DeliveryDate" style="width: 90px" readonly="readonly" ms-widget="date,delivedateid,delivedateOpts">
                </td>

            </tr>
            <tr>
                <th>收货人：
                </th>
                <td>
                    <input type="hidden" ms-duplex="entity.Consignee" />
                    <input type="text" ms-duplex="entity.ConsigneeDisplay" style="width: 100px">
                    <select style="width: 100px; margin-top: -6px;" ms-change="cnsigneChange">
                        <option value="">选择收货人</option>
                        <option ms-repeat-con="CustomerContactData" ms-value="con.Id">{{con.Name}}</option>
                    </select>
                </td>
                <th>运费承担：
                </th>
                <td>
                    <input type="text" ms-duplex="entity.FreightBearRemark" style="width: 200px">
                </td>
            </tr>
            <tr>
                <th>收货电话：
                </th>
                <td>
                    <input type="text" ms-duplex="entity.ConsigneePhone" style="width: 100px">
                </td>
                <th>交付/收货地址：
                </th>
                <td>
                    <input type="text" ms-duplex="entity.ConsigneeAddress" style="width: 250px">
                </td>
            </tr>
            <tr>
                <th>3.发货说明：
                </th>
                <td colspan="3">
                    <input type="text" ms-duplex="entity.ConsigneeRemark" style="width: 670px;">
                </td>
            </tr>
        </tbody>
    </table>
    </div>
</div>
<div class="tabContent" ms-if="tab=='tab4'">
    <table style="width: 100%; margin: 0 auto;" border="0" cellspacing="1" cellpadding="0" class="tableList">
        <tr class="minhead" align="center">
            <td width="5%">期次
            </td>
            <td width="10%">结算单位
            </td>
            <td width="8%">项目
            </td>
            <td width="10%">收付
            </td>
            <td width="6%">金额
            </td>
            <td width="6%">结算方式
            </td>
            <td width="6%">费用日期
            </td>
            <td width="6%">计划日期
            </td>
            <td width="6%">责任人
            </td>
            <td width="6%">操作
            </td>
        </tr>
        <tbody>
            <tr align="center" style="background-color: #ffffff;" ms-repeat-item="arapList">
                <td>
                    <input type="text" ms-duplex="item.Batch"  style="width: 50px;" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.SettleCustomerName" style="width: 100px;" />
                    <button class="myfbt" type="button" ms-click='selectSettleCustomer(item)'>
                        <i class="customer"></i>
                    </button>
                </td>
                <td>
                    <input type="text" ms-duplex="item.Project" style="width: 70px;" />
                    <button ms-click="selectProject(item)" class="myfbt" type="button">
                        <i class="customer"></i>
                    </button>
                </td>
                <td>
                    <select ms-duplex-text="item.Type" style="width:50px;">
                        <option value="0">收</option>
                        <option value="1">付</option>
                    </select>
                </td>
                <td>
                    <input type="text" ms-duplex="item.Money" style="width: 80px;" />
                </td>
                <td>
                    <select ms-duplex-text="item.SettleWay" style="width:80px;">
                        <option value="">请选择</option>
                        <option ms-repeat-r="settleWays">{{r.Data}}</option>
                    </select>
                </td>
                <td>
                    <input ms-duplex="item.CostDate" ms-widget="date" data-format="%Y-%m-%d" type="text" style="width: 80px;" />
                </td>
                <td>
                    <input ms-duplex="item.PlanDate" ms-widget="date" data-format="%Y-%m-%d" type="text" style="width: 80px;" />
                </td>
                <td>
                    <input type="text" ms-duplex="item.DutyPersonName" style="width: 60px;" />
                    <button class="myfbt" type="button" ms-click='selectDutyPerson(item)'>
                        <i class="iadduser"></i>
                    </button>
                </td>
                <td align="center">
                    <a ms-click="delArap($index,item.Id)" href="javascript:void(0)" class="dodel" title="移除"></a>
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    合计应收：{{arapSum.m1}}，应付：{{arapSum.m2}}，利润：{{arapSum.m3}}
                </td>
            </tr>
            <tr>
                <td colspan="10">
                    <a href="javascript:void(0)" ms-click="addArap()">新增一行</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
