<div ms-controller="ProductStorageView">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <td width="198" height="450" valign="top" id="tdleft" style="border-bottom: #d2d2d2 1px solid;">
                    <!--leftNav-->
                    <div id="left" ms-widget="leftMenu,productStorageMenu">
                    </div>
                    <!--End leftNav-->
                </td>
                <td width="10">&nbsp;</td>
                <td style="width:198px;vertical-align: top;">
                    <table cellpadding="0" cellspacing="0" height="100%" class="bordergrag top10">
                        <tr>
                            <td style="vertical-align: top;">
                                <div class="boxTitlenoneb">
                                    <h2>
                                        <a href="javascript:void(0)" ms-click="expanCategory" style="color: #016b96; float: right; margin-right: 5px; font-size: 12px; font-weight: normal;">+ 展开</a>
                                        产品分类
                                    </h2>
                                    <ul id="storageListCategoryTree" class='ztree' ms-widget="productCategoryTree,pStorageListCategoryTree,pCategoryTreeOpts" style="width: 198px; height:500px; overflow: auto;"></ul>
                                    <br>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="10">&nbsp;</td>
                <td valign="top" style="padding-right:5px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable top10" id="seacrhTable">
                        <tbody>
                            <tr>
                                <td class="searchico">
                                    <div class="input-append" style="margin-bottom: 0px;">
                                        <input type="text" class="span4" ms-duplex='key' placeholder="输入产品编号、产品名称等关键字" ms-keypress='toEnter'>
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click='toSearch' ms-html='lang.SearchBtn'></button>
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clearQuery" ms-html='lang.ShowAllBtn'></button>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="seacrhField">
                        <tbody>
                            <tr class="quickword" ms-repeat="queryData" ms-if-loop="$val.items">
                                <td colspan="2"><span>{{$val.label}}</span>
                                    <div style="display: inline;">
                                        <a ms-repeat-r='$val.items' href="javascript:void(0)" ms-click='addQuery($key,r.val)' ms-class-selected="r.curr" ms-html='r.label'></a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="seabox">
                                    <span class="first" ms-html='lang.CurrSearchCondition'></span>
                                    <div style="display: inline;float:left;" ms-repeat="queryData">
                                        <span class="searchItem" ms-if-loop='$val.valLabel'>{{$val.valLabel}}
                                        <i><a href="javascript:void(0)" ms-click='removeQuery($key)'></a></i>
                                        </span>
                                    </div>
                                    <span class="last" ms-visible='hasQuery' ms-click='clearQuery'><a href="javascript:void(0)" ms-html='lang.ClearAll'></a></span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="boxTitlenob top10">
                        <h2>产品库存分布</h2>
                    </div>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList" style="margin-bottom: 1px;">
                    <thead>
                        <tr class="head" style="background-color: rgb(250, 250, 250);">
                            <td align="center">产品编号</td>
                            <td align="center" style=" width:40%">名称</td>
                            <td align="center">类别</td>
                            <td align="center">型号</td>
                            <td ms-repeat-item="storagelist" align="center">{{item.Name}}</td>
                        </tr>
                    </thead>
                    <tbody> 
                        <tr ms-repeat-item="grid1.list">
                            <td align="center">{{item.ProductNo}}</td>
                            <td ms-attr-title="{{item.ProductName}}" align="left">{{item.ProductName|truncate(30,"…")}}</td>
                            <td align="center">{{item.CategoryName}}</td>
                            <td align="center">{{item.Standard}}</td>
                            <td  ms-repeat-item="item.Storage" align="center">{{item.Inventory}}</td>
                        </tr> 
                    </tbody>
                    <tfoot>
                        <tr>
                           <td ms-attr-colspan="{{ storagecount }}" ms-widget='paging,ProductStorageViewListPage,listOpts'>
                           </td>
                        </tr>
                    </tfoot>
                </table> 
            </td>
            </tr>
        </tbody>
    </table>

    <!--查看-->
    <noscript id="viewTemplate">
        <div ms-css-width="tabWidth" class="tabContent2">
            <table width="98%" cellspacing="1" cellpadding="2" border="0" class="tablecInfo">
                <tbody>
                    <tr>
                        <td style="width:90px;">仓库类别
                        </td>
                        <td>
                            {{entity.TypeName}}
                        </td>
                        <td style="width:90px;">仓库形态
                        </td>
                        <td>
                            {{entity.Form?"虚拟仓库":"实体仓库"}}
                        </td>
                    </tr>
                    <tr>
                        <td>仓库编号
                        </td>
                        <td>
                            {{entity.No}}
                        </td>
                        <td>状态
                        </td>
                        <td>
                            <span class="statebtn" ms-class-1="enabled:entity.State==1" ms-class-2="disabled:entity.State==0">{{entity.State==1?"已启用":"已禁用"}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td>仓库名称
                        </td>
                        <td>
                            {{entity.Name}}
                        </td>
                        <td>拼音简码
                        </td>
                        <td>
                            {{entity.NameLetter}}
                        </td>
                    </tr>
                    <tr>
                        <td>仓库地址
                        </td>
                        <td>
                            {{entity.Address}}
                        </td>
                        <td>联系电话
                        </td>
                        <td>
                            {{entity.Tel}}
                        </td>
                    </tr>
                    <tr>
                        <td>备注
                        </td>
                        <td colspan="3">
                            {{entity.Remark}}
                        </td>
                    </tr>
                    <tr>
                        <td>是否启用多仓位
                        </td>
                        <td colspan="3">
                            {{entity.MultipleSpace?"已启用":"未启用"}}
                        </td>
                    </tr>
                </tbody>
            </table>
            <table ms-if="entity.MultipleSpace" width="98%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10">
            <tr class="head">
                <td width="40%" align="center" bgcolor="#FFFFFF">
                    仓位编号
                </td>
                <td width="60%" align="center" bgcolor="#FFFFFF">仓位名称
                </td>
            </tr>
            <tbody>
                <tr ms-repeat-item="spaceList">
                    <td align="center" bgcolor="#FFFFFF">
                        {{item.No}}
                    </td>
                    <td bgcolor="#FFFFFF">
                        {{item.Name}}
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </noscript>

    <!--分类-->
    <noscript id="typeTmpl">
        <div class="tabContent2" style="width:600px;">
            <table width="98%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10">
            <tr class="head">
                <td width="60%" align="center" bgcolor="#FFFFFF">
                    名称
                </td>
                <td width="30%" align="center" bgcolor="#FFFFFF">排序
                </td>
                <td width="10%" align="center" bgcolor="#FFFFFF">操作
                </td>
            </tr>
            <tbody>
                <tr ms-repeat-item="typeList">
                    <td bgcolor="#FFFFFF">
                        <input type="text" ms-duplex="item.Data" style="width:90%;margin-bottom:3px;text-align:center;">
                    </td>
                    <td bgcolor="#FFFFFF">
                        <input type="text" ms-duplex="item.Sort" style="width:90%;margin-bottom:3px;text-align:center;">
                    </td>
                    <td bgcolor="#FFFFFF" style="text-align:center;">
                        <a ms-if="!$first" title="删除" href="javascript:void(0)" ms-click="removeType($index)" class="dodel"></a>
                        <a ms-if="$first" title="第一条不能删除" href="javascript:void(0)" class="nodel"></a>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <a href="javascript:void(0)" ms-click="addType">+&nbsp;新增一行</a>
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </noscript>
</div>
