<table border="0" align="center" cellpadding="0" cellspacing="0" id="mian" ms-controller="marketingmaterialsorprint">
    <tbody>
        <tr>
            <!--leftNav-->
            <td width="198" height="450" valign="top" id="tdleft">
                <div id="left" ms-widget="materialsGiftMenu">
                </div>
                <!--End leftNav-->
            </td>
            <td valign="top" id="right" class="addrightbg">
                <div class="boxtip" id="boxtip">
                    <h1>物料/印刷品列表 </h1>
                    <p>列出物料/印刷品,用于平时的使用和管理 </p>
                    <a href="javascript:void(0)" class="btn_back"></a>
                </div>
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhTable">
                    <tbody>
                        <tr>
                            <td width="460" class="searchico">
                                <div class="input-append" style="margin-bottom: 10px;">
                                    <input type="text" class="span4" ms-duplex="keyword" placeholder="请输入物料/印刷品名称快速检索">
                                    <button class="add-on ibtsearch" type="button" id="btnsel" ms-click="search" style="height: 28px; font-size: 12px; padding: 3px 12px;">
                                        {{lang.SearchBtn}}
                                    </button>
                                    <button class="add-on ibtsearch clearall" type="button" ms-click="clear" style="height: 28px; font-size: 12px; padding: 3px 12px;">
                                        {{lang.ShowAllBtn}}</button>
                                </div>
                            </td>
                            <td class="fgray">
                                <span style="float: left;">{{lang.SearchHistory}}</span><div class="hotlist">
                                    <span class="bindSearchHistory" ms-each-item="history">
                                        <a href="javascript:void(0)" ms-value="item" ms-click="historyClick">{{item}}&nbsp;&nbsp;</a>
                                    </span>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhField">
                    <tbody>
                        <tr class="quickword">
                            <td>
                                <span id="materialtype">物料类型</span>
                                <div style="display: inline;">
                                    <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="0" key="materialtype">{{lang.Unlimited}}</a>
                                    <a href="javascript:void(0)" ms-repeat-item="materialTypeData" ms-click="itemClick" ms-attr-value="item.Id" key="materialtype">{{item.Data}}</a>
                                </div>
                            </td>
                        </tr>
                        <tr class="quickword">
                            <td>
                                <span id="countunit">计量单位</span>
                                <div style="display: inline;">
                                    <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="0" key="countunit">{{lang.Unlimited}}</a>
                                    <a href="javascript:void(0)" ms-repeat-item="countUnitData" ms-click="itemClick" ms-attr-value="item.Id" key="countunit">{{item.Data}}</a>
                                </div>
                            </td>
                        </tr>
                        <tr class="quickword">
                            <td>
                                <span id="stocknum" style="padding-right: 16px;">库存量</span>
                                <div style="display: inline;">
                                    <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="0" key="stocknum">全部</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="1" key="stocknum">0</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="2" key="stocknum">1—50</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="3" key="stocknum">51—100</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="4" key="stocknum">101—300</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="5" key="stocknum">300以上</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="seabox"><span class="first">{{lang.CurrSearchCondition}}</span>
                                <div style="display: inline;" ms-with="showItem">
                                    <span class="searchItem" ms-if="$val">{{$val}}<i><a href="javascript:void(0)" ms-click="remove"></a></i></span>
                                </div>
                                <span class="last" ms-if="has"><a href="javascript:void(0)" ms-click="clear">{{lang.ClearAll}}</a></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <!--<div class="boxTitlenob">
                    <h2>物料/印刷品列表</h2>
                </div>-->
                <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList">
                    <thead>
                        <tr class="dobtn" style="background-color: rgb(255, 255, 255);">
                            <td colspan="9">
                                <a ms-if="ADD" href="javascript:void(0)" class="doadd" ms-click="doadd">{{lang.AddBtn}}</a>
                                <a ms-if="DELETE" href="javascript:void(0)" class="doalldel" ms-click="doalldel">{{lang.BtachDelBtn}}</a>
                            </td>
                        </tr>
                        <tr class="head" style="background-color: rgb(250, 250, 250);">
                            <td width="3%" align="center">
                                <input type="checkbox" class="checkAll">
                            </td>
                            <td width="7%" align="center">物料类型
                            </td>
                            <td width="26%" align="center">物料/印刷品名称
                            </td>
                            <td width="30%" align="center">对应供应商
                            </td>
                            <td width="7%" align="center">购入量
                            </td>
                            <td width="7%" align="center">库存量
                            </td>
                            <td width="10%" align="center">购入时间
                            </td>
                            <td width="10%" align="center">操作
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ms-repeat-item="materialsorprintList" style="background-color: rgb(255, 255, 255);">
                            <td align="center">
                                <input type="checkbox" name="checkbox" ms-value="item.Id">
                            </td>
                            <td align="center">{{item.MaterialTypeDisplay}}
                            </td>
                            <td align="left">
                                <a href="javascript:void(0)" ms-click="doview" ms-value="item.Id">{{item.Name}}</a>
                            </td>
                            <td align="left">
                                <a ms-href="'#/Customer/DetailCustomer/'+item.SupliersId">{{item.SupliersDisplay}}</a>
                            </td>
                            <td align="center">{{item.Amount}}({{item.CountUnitDisplay}})
                            </td>
                            <td align="center">{{item.Stock}}({{item.CountUnitDisplay}})
                            </td>
                            <td width="10%" align="center">{{item.BuyTime}}
                            </td>
                            <td align="center">
                                <a ms-if="item.NECK" ms-href="'#/Market/MaterialsUse/'+item.Id+'/'+ encodeURI(item.Name)" class="doneck" title="领用"></a>
                                <a href="javascript:void(0)" class="doview" ms-click="doview" ms-value="item.Id" ms-title="lang.ViewBtn"></a>
                                <a ms-if="item.EDIT" href="javascript:void(0)" class="doedit" ms-click="doedit" ms-value="item.Id" ms-title="lang.EditBtn"></a>
                                <a ms-if="!item.EDIT" href="javascript:void(0)" class="noedit" ms-title="lang.EditBtn"></a>
                                <a ms-if="item.DELETE" href="javascript:void(0)" class="dodel" ms-click="dodel" ms-attr-index="$index" ms-value="item.Id" ms-title="lang.DelBtn"></a>
                                <a ms-if="!item.DELETE" href="javascript:void(0)" class="nodel" ms-title="lang.DelBtn"></a>
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr style="background-color: rgb(255, 255, 255);">
                            <td colspan="9" ms-widget='paging,upaing,materialsorprintpaing'></td>
                        </tr>
                    </tfoot>
                </table>
            </td>
        </tr>
    </tbody>
</table>


<!--新增或修改--->
<noscript type="text/avalon" id="formTemplatePrint">
    <table cellspacing="0" cellpadding="0" width="100%" border="0" class="formTable">
        <tbody>
            <tr>
                <td width="110">印刷品/物料名称：
                </td>
                <td height="25" width="350" align="left">
                    <input ms-duplex="entity.Name" type="text" style="width: 200px;"><span class="must">*</span>
                </td>
                <td width="80">物料类型：
                </td>
                <td height="25" width="130" align="left">
                    <select ms-duplex="entity.MaterialType">
                        <option ms-repeat-item="materialTypeData" ms-value="item.Id">{{item.Data}}</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>对应供应商：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.SupliersId" type="hidden" />
                    <input ms-duplex="entity.SupliersDisplay" type="text" readonly="readonly" style="width: 200px;">
                    <button class="myfbt" ms-click="selectSupliers()" type="button"><i class="customer"></i></button>
                    <span class="must">*</span>
                </td>
                <td>对应联系人：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.ContactId" type="hidden">
                    <input ms-duplex="entity.ContactDisplay" type="text" readonly="readonly" style="width: 120px;">
                </td>
            </tr>
            <tr>
                <td>购入数量：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.Amount" ms-blur="sumAount" type="text" style="width: 120px;">
                </td>
                <td>库存量：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.Stock" type="text" style="width: 120px;" readonly="readonly">
                </td>
            </tr>
            <tr>
                <td>单位：
                </td>
                <td height="25" align="left" colspan="3">
                    <select ms-duplex="entity.CountUnit">
                        <option ms-repeat-item="countUnitData" ms-value="item.Id">{{item.Data}}</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>单价：
                </td>
                <td height="25" align="left">
                    <div class="input-append">
                        <input ms-duplex="entity.Price" ms-blur="sumAount" type="text" value="0" style="width: 90px;">
                        <span class="add-on">元</span>
                    </div>
                </td>
                <td>总价：
                </td>
                <td height="25" align="left">
                    <div class="input-append">
                        <input ms-duplex="entity.TotalPrice" type="text" readonly="readonly" style="width: 90px;">
                        <span class="add-on">元</span>
                    </div>
                </td>
            </tr>

            <tr>
                <td>物料说明：
                </td>
                <td height="25" align="left" colspan="3">
                    <textarea ms-duplex="entity.Description" rows="2" cols="20" style="height: 60px; width: 98%;"></textarea>
                </td>
            </tr>
            <tr>
                <td>购入人：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.BuyerId" type="hidden">
                    <input ms-duplex="entity.BuyerDisplay" type="text" readonly="readonly" style="width: 120px;">
                </td>
                <td>购入时间：
                </td>
                <td height="25" align="left">
                    <input ms-duplex="entity.BuyTime" type="text" readonly="readonly" style="width: 120px;">
                </td>
            </tr>
        </tbody>
    </table>
</noscript>

<!--查看-->
<noscript type="text/avalon" id="viewTemplatePrint">
    <table cellspacing="1" cellpadding="0" width="98%" border="0" class="tablecInfo">
        <tbody>
            <tr style="background-color: rgb(255, 255, 255);">
                <td width="120">印刷品/物料名称：
                </td>
                <td height="25" width="320" align="left">{{entity.Name}}
                </td>
                <td width="120">物料类型：
                </td>
                <td height="25" width="160" align="left">{{entity.MaterialTypeDisplay}}
                </td>
            </tr>
            <tr style="background-color: rgb(246, 246, 246);">
                <td>对应供应商：
                </td>
                <td height="25" width="*" align="left">{{entity.SupliersDisplay}}
                </td>
                <td>对应联系人：
                </td>
                <td height="25" width="*" align="left">{{entity.contactDisplay}}
                </td>
            </tr>
            <tr style="background-color: rgb(246, 246, 246);">
                <td>购入数量：
                </td>
                <td height="25" width="*" align="left">{{entity.Amount}}
                </td>
                <td>库&nbsp;存&nbsp;量：
                </td>
                <td height="25" width="*" align="left">{{entity.Stock}}
                </td>
            </tr>
            <tr style="background-color: rgb(246, 246, 246);">
                <td>单位：
                </td>
                <td height="25" width="*" align="left" colspan="3">{{entity.CountUnitDisplay}}
                </td>
            </tr>
            <tr style="background-color: rgb(255, 255, 255);">
                <td>单&nbsp;&nbsp;&nbsp;&nbsp;价：
                </td>
                <td height="25" width="*" align="left">{{entity.Price}}
                </td>
                <td>总&nbsp;&nbsp;&nbsp;&nbsp;价：
                </td>
                <td height="25" width="*" align="left">{{entity.TotalPrice}}
                </td>
            </tr>
            <tr style="background-color: rgb(255, 255, 255);">
                <td>物料说明：
                </td>
                <td height="25" width="*" align="left" colspan="3">
                    <div style="height: 80px; overflow: auto;">{{entity.Description}}</div>
                </td>
            </tr>
            <tr style="background-color: rgb(255, 255, 255);">
                <td>购&nbsp;入&nbsp;人：
                </td>
                <td height="25" width="*" align="left">{{entity.BuyerDisplay}}
                </td>
                <td>购入时间：
                </td>
                <td height="25" width="*" align="left">{{entity.BuyTime}}
                </td>
            </tr>
        </tbody>
    </table>
</noscript>
