<table border="0" align="center" cellpadding="0" cellspacing="0" id="mian" ms-controller="marketingmaterialsorprintuse">
    <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:history.go(-1)" 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="operationval">操作行为：</span>
                                <div style="display: inline;">
                                    <a href="javascript:void(0)" class="selected" ms-click="itemClick" value="0" key="operationval">不限</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="1" key="operationval">领用</a>
                                    <a href="javascript:void(0)" ms-click="itemClick" value="2" key="operationval">归还</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="20%" align="center">领用物料名称
                            </td>
                            <td width="7%" align="center">数量
                            </td>
                            <td width="33%" align="center">发给对应客户
                            </td>
                            <td width="10%" align="center">领用人
                            </td>
                            <td width="12%" align="center">领用时间
                            </td>
                            <td width="5%" align="center">行为
                            </td>
                            <td width="10%" align="center">操作
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ms-repeat-item="materialsorprintuseList" style="background-color: rgb(255, 255, 255);">
                            <td align="center">
                                <input type="checkbox" name="checkbox" ms-value="item.Id">
                            </td>
                            <td align="left"><a ms-href="'#/Market/MaterialsOrPrint/'+item.MaterialsId">{{item.MaterialsDisplay}}</a>
                            </td>
                            <td align="center">{{item.Num}}
                            </td>
                            <td align="left">
                                <a ms-href="'#/Customer/DetailCustomer/'+item.CustomerId">{{item.CustomerDisplay}}</a>
                            </td>
                            <td align="center">{{item.UserDisplay}}
                            </td>
                            <td align="center">{{item.UseTime}}
                            </td>
                            <td align="center">{{item.OperationValDisplay}}
                            </td>
                            <td align="center">
                                <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,materialsorprintusepaing'></td>
                        </tr>
                    </tfoot>
                </table>
            </td>
        </tr>
    </tbody>
</table>

<!--新增或修改--->
<noscript type="text/avalon" id="formTemplatePrintUse">
    <table cellspacing="0" cellpadding="0" width="96%" border="0" class="formTable">
        <tbody>
            <tr>
                <td width="105px">领用人：
                </td>
                <td height="25" width="350" align="left">
                    <input type="hidden" ms-duplex="entity.User_Id" />
                    <input type="text" ms-duplex="entity.UserDisplay" readonly="readonly" />
                    <button type="button" class="myfbt" ms-click="selectUser()"><i class="iadduser"></i></button>
                </td>
                <td width="80px">领用时间：
                </td>
                <td height="25" width="165" align="left">
                    <input type="text" ms-duplex="entity.UseTime" ms-widget="date,useTimeId,useTimeOpts" readonly="readonly" style="width: 130px;" />
                </td>
            </tr>
            <tr>
                <td>印刷品/物料名称：
                </td>
                <td height="25" width="*" align="left">
                    <input ms-duplex="entity.MaterialsId" type="hidden">
                    <input ms-duplex="entity.MaterialsDisplay" type="text" readonly="readonly">
                    <button class="myfbt" ms-click="selectPrint" type="button"><i class="customer"></i></button>
                    <span class="must">*</span>
                    <div ms-visible="printPanel" class="dropdownPanel" style="width: 510px; display: none; position: absolute;" ms-mousedown="mousedownstop">
                        <div>
                            <div class="boxTitlenob" style="margin-left: 0;">
                                <h2>
                                    <span class="rseachbox">
                                        <input style="margin-bottom: 0px;" ms-duplex="printKey" type="text">
                                        <button type="button" class="inputbt" ms-click="searchPrint">
                                        </button>
                                    </span>
                                    <span style="float: right">
                                        <button type="button" ms-click="closePrintPanel">{{lang.Close}}</button>
                                    </span>
                                </h2>
                            </div>
                            <div style="height: 200px; overflow: auto; background-color: rgb(255, 255, 255);">
                                <table width="100%" align="center" border="0" cellspacing="1" cellpadding="0" class="tableList">
                                    <thead>
                                        <tr class="head">
                                            <td width="20%" align="center">名称</td>
                                            <td width="8%" align="center">类型</td>
                                            <td width="10%" align="center">库存量</td>
                                            <td width="10%" align="center">单价</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ms-repeat-item="printList" style="background-color: rgb(255, 255, 255); cursor: pointer;" ms-live-click="clickPrint" ms-attr-key="item.Id" ms-attr-alt="item.Name" title="点击选择">
                                            <td align="center">{{item.Name}}
                                            </td>
                                            <td align="center">{{item.MaterialTypeDisplay}}
                                            </td>
                                            <td align="center">{{item.Stock}}({{item.CountUnitDisplay}})
                                            </td>
                                            <td align="center">{{item.Price}}
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </td>
                <td>数量：
                </td>
                <td height="25" width="*" align="left">
                    <input ms-duplex="entity.Num" type="text" style="width: 130px;"><span class="must">*</span>
                </td>
            </tr>
            <tr>
                <td align="left">对应客户：&nbsp;&nbsp;
                </td>
                <td colspan="3">
                    <input type="hidden" ms-duplex="entity.CustomerId" />
                    <input ms-duplex="entity.CustomerDisplay" type="text" readonly="readonly">
                    联系人
                    <input type="hidden" ms-duplex="entity.ContactId" />
                    <input ms-duplex="entity.ContactDisplay" type="text" readonly="readonly" style="width: 120px;">
                    <span class="must">*</span>
                    <button ms-click="selectCustomer()" class="myfbt" type="button">
                        <i class="customer"></i>
                    </button>
                    <span class="helptip"><a href="#" data-toggle="tooltip" data-placement="top" title="选择联系人后会自动加载客户名称。">&nbsp;&nbsp; </a></span>
                </td>
            </tr>
            <tr>
                <td>用途：
                </td>
                <td height="25" width="*" align="left" colspan="3">
                    <textarea ms-duplex="entity.UseOfConditions" rows="2" cols="20" style="height: 100px; width: 94%;"></textarea>
                </td>
            </tr>
            <tr ms-visible="entity.Id>0">
                <td>操作行为：
                </td>
                <td height="25" width="*" align="left" colspan="3">
                    <select ms-duplex="entity.OperationVal" style="width: 100px;">
                        <option value="1">领用</option>
                        <option value="2">归还</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>经手发放人：
                </td>
                <td height="25" width="*" align="left">
                    <input type="hidden" ms-duplex="entity.PostBy" />
                    <input ms-duplex="entity.PostByDisplay" type="text" readonly="readonly" style="width: 100px;">
                </td>
                <td height="25" width="*" align="left">&nbsp;
                </td>
                <td height="25" width="*" align="left">&nbsp;
                </td>
            </tr>
        </tbody>
    </table>
</noscript>

<!--查看-->
<noscript type="text/avalon" id="viewTemplatePrintUse">
    <table cellspacing="1" cellpadding="0" width="100%" border="0" class="tablecInfo">
        <tbody>
            <tr>
                <td width="95">领用人：
                </td>
                <td height="25" width="200" align="left">{{entity.UserDisplay}}
                </td>
                <td width="95">领用时间：
                </td>
                <td height="25" align="left" width="200">{{entity.UseTime | truncate(10,'')}}
                </td>
            </tr>
            <tr>
                <td>礼品/赠品名称：
                </td>
                <td height="25" width="*" align="left">{{entity.GiftDisplay}}
                </td>
                <td>数量：
                </td>
                <td height="25" width="*" align="left">{{entity.Num}}
                </td>
            </tr>
            <tr>
                <td align="left">对应客户：
                </td>
                <td>{{entity.CustomerDisplay}}
                </td>
                <td align="left">联系人：
                </td>
                <td>{{entity.ContactDisplay}} 
                </td>
            </tr>
            <tr>
                <td>用途：
                </td>
                <td width="*" align="left" colspan="3">
                    <div style="height: 150px; overflow: auto;">{{entity.UseOfConditions}}</div>
                </td>
            </tr>
            <tr>
                <td>经手发放人：
                </td>
                <td height="25" width="*" align="left" colspan="3">{{entity.PostByDisplay}}
                </td>

            </tr>
        </tbody>
    </table>
</noscript>
