<div style="padding: 10px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
        <tr>
            <th width="100">{{lang.ContractName1}}：
            </th>
            <td>
                <input type="text" ms-duplex="entity.ContractName" ms-attr-placeholder="lang.InputContract" style="width: 288px;" />
                <span class="must">*</span>
            </td>
            <th width="100">{{lang.ContractNumber1}}：</th>
            <td>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="120">
                            <select ms-duplex="entity.ContractType" style="width: 110px;" ms-each-item="contracttypedata">
                                <option ms-value="item.Id">{{item.Data}}</option>
                            </select>
                        </td>
                        <td width="300">
                            <input type="text" ms-duplex="entity.ContractNum" style="width: 80px;" />
                            <span class="must">*</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th style="width: 60px;">客户：</th>
            <td style="width: 500px;">
                <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>
            </td>
            <th>{{lang.SignDateTime}}：
            </th>
            <td>
                <input type="text" ms-duplex="entity.SignAContractDate" style="width: 90px;" readonly="readonly" ms-widget="date,signacontractdateid,signacontractdateOpts" />
                <span class="must">*</span>
            </td>
        </tr>
        <tr>
            <th>联系人：
            </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>
            <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="text" ms-duplex="entity.CustomerMobile" style="width: 100px;" />
            </td>
            <th>发货方式：
            </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>
        </tr>
        <tr>
            <th>地址：
            </th>
            <td>
                <input type="text" ms-duplex="entity.ConsigneeAddress" style="width: 210px">
            </td>
            <th width="70">付款方式：
            </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>
        </tr>
    </table>

    <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="10%">产品单价
            </td>
            <td width="6%">{{lang.Price}}
            </td>
            <td width="6%">{{lang.Quantity}}
            </td>
            <td width="6%">成交金额
            </td>
            <td width="3%" align="center">{{lang.Operate}}
            </td>
        </tr>
        <tr ms-repeat-item="contractdetailslist" align="center" style="background-color: rgb(255, 255, 255);" 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-live-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" readonly="readonly" 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: 30px;" readonly="true" />
            </td>
            <td>
                <input type="text" ms-duplex="item.Price" style="width: 30px;" data-id="Price" ms-blur="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-blur="onSumRowMoney(item)" ms-attr-index="$index" />
                    <span class="add-on">{{item.UnitsDisplay}}</span>
                </div>
            </td>
            <td>
                <input type="text" ms-duplex="item.Money" ms-blur="onSumCost" style="width: 60px;" />
            </td>
            <td align="center">
                <a href="javascript:void(0)" class="dodel" ms-attr-index="$index" ms-click="onRelevanceDel('contractdetails')"></a>
            </td>
        </tr>

    </table>

    <table width="100%" border="0" cellspacing="2" cellpadding="0" class="commontable shortSelect">
        <tr style="background: #ffffff;">
            <td valign="top" style="width: 20%;"><a style="color: blue;" ms-click="onRelevanceAdd('contractdetails')" href="javascript:void(0);">&nbsp;&nbsp;+新增一行</a></td>
            <td style="text-align: right; width: 65%;">小计&nbsp;</td>
            <td style="text-align: left; width: 15%;">
                <input type="text" ms-duplex="entity.CountAmount" style="width: 80px; margin: 0; padding: 0 1px;" 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>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: right; width: 85%;">
                <span style="text-align: right;" style="background: #ffffff;">上述价格
                                    <label>
                                        <input type="checkbox" ms-duplex-radio="entity.ContainsTax" />另计税金</label><span ms-visible="entity.ContainsTax">（小计 × 税率</span>

                    <span ms-visible="entity.ContainsTax">
                        <input type="text" ms-duplex="entity.TaxRate" ms-blur="onSumTax" style="width: 50px; 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>

                    <span style="text-align: right; background: #ffffff;" ms-visible="entity.ContainsTax">&nbsp;＝&nbsp;税额</span>
                    <span ms-visible="entity.ContainsTax">
                        <!-- <input type="text" ms-duplex="entity.FillUpTax" style="width: 50px; 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>
                                      -->
                        {{entity.FillUpTax}}元）
                    </span>
                </span>
                <span style="text-align: right; background: #ffffff;">－优惠</span>
                <span>
                    <input type="text" ms-duplex="entity.FavourableAmount" ms-blur="onSumTax" style="width: 50px; 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>
                <span style="text-align: right; background: #ffffff;">&nbsp;＝&nbsp;合同总金额</span>
            </td>
            <td style="text-align: left; width: 15%">
                <input type="text" ms-duplex="entity.Amount" style="width: 80px; margin: 0; padding: 0 1px;" />
                <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 style="background: #ffffff;">
            <td colspan="3" style="text-align: left">
                <input type="text" id="txtRemark" ms-muplex="entity.Remark" />
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellspacing="2" cellpadding="0" class="commontable shortSelect">
        <tr>
            <th>{{lang.ContractState1}}：
            </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>
                <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>
            <th>{{lang.CurrentStage1}}：
            </th>
            <td>
                <select ms-duplex="entity.CurrentStage" style="width: 93px;" ms-each-item="contractstagedata">
                    <option ms-value="item.Id">{{item.Data}}</option>
                </select>
            </td>
        </tr>
        <tr>
            <th>{{lang.BelongToEmployee}}：
            </th>
            <td>
                <input type="hidden" ms-duplex="entity.BelongTo" />
                <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>{{entity.AddBy.FullName}}</td>
            <th>录入时间：</th>
            <td>
                <input ms-duplex="entity.AddTime" ms-widget="date" style="width: 135px;" />
            </td>
        </tr>
    </table>
</div>
