<div ms-controller="ProductStorageList">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <!--leftNav-->
                <td width="198" height="450" valign="top" id="tdleft" style="border-bottom: #d2d2d2 1px solid;">
                    <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" id="right" style="padding: 0px;">
                    <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 style="height: 520px; overflow: auto;">
                        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList">
                            <thead>
                                <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0);" ms-if="STORAGEINIT">
                                    <td colspan="10">
                                        <a class="doadd" href="javascript:void(0)" ms-click="storageInit">期初库存</a>
                                    </td>
                                </tr>
                                <tr class="head" style="background-color: rgb(250, 250, 250);">
                                    <td width="15%" align="center">产品编号
                                    </td>
                                    <td width="25%" align="center">名称
                                    </td>
                                    <td width="15%" align="center">类别
                                    </td>
                                    <td width="15%" align="center">型号
                                    </td>
                                    <td width="10%" align="center">单位
                                    </td>
                                    <td width="10%" align="center">标准售价
                                    </td>
                                    <td width="10%" align="center">库存数量
                                    </td>
                                    <td width="10%" align="center">库存成本价
                                    </td>
                                    <td width="10%" align="center">库存成本额
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ms-repeat-item="grid1.list">
                                    <td align="left">{{item.No}}
                                    </td>
                                    <td align="left">{{item.Name}}
                                    </td>
                                    <td align="left">{{item.CategoryName}}
                                    </td>
                                    <td align="center">{{item.Standard}}
                                    </td>
                                    <td align="center">{{item.UnitsDisplay}}
                                    </td>
                                    <td align="center">{{item.GeneralCustomerPrice}}
                                    </td>
                                    <td align="center">{{item.CurrentStockNum}}
                                    </td>
                                    <td align="center">{{item.CostPrice}}
                                    </td>
                                    <td align="center">{{item.CostMoney}}
                                    </td>
                                </tr>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="10" ms-widget='paging,ProductStorageListListPage,listOpts'></td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>

                </td>
            </tr>
        </tbody>
    </table>

    <!--新增和编辑-->
    <noscript id="formTemplate">
        <div ms-css-width="tabWidth" class="tabContent2">
            <table width="98%" cellspacing="2" cellpadding="0" border="0" class="commontable">
                <tbody>
                    <tr>
                        <th style="width: 80px;">仓库类别：
                        </th>
                        <td style="width: 278px;">
                            <select ms-duplex-text="entity.TypeId">
                                <option value="">请选择</option>
                                <option ms-repeat-r="types" ms-value="r.Id" ms-text="r.Data"></option>
                            </select>
                            <span class="must">*</span>
                        </td>
                        <th style="width: 80px;">仓库形态：
                        </th>
                        <td>
                            <label>
                                <input type="radio" value="0" ms-duplex-text="entity.Form" />实体仓库</label>
                            <label>
                                <input type="radio" value="1" ms-duplex-text="entity.Form" />虚拟仓库</label>
                        </td>
                    </tr>
                    <tr>
                        <th>仓库编号：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.No" style="width: 117px;"><span class="must" style="margin-left: 8px;">*</span>
                        </td>
                        <th>状态：
                        </th>
                        <td>
                            <label>
                                <input type="radio" value="1" ms-duplex-text="entity.State" />已启用</label>
                            <label style="margin-left: 18px;">
                                <input type="radio" value="0" ms-duplex-text="entity.State" />已禁用</label>
                        </td>
                    </tr>
                    <tr>
                        <th>仓库名称：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.Name" id="storageName" style="width: 117px;"><span class="must" style="margin-left: 8px;">*</span>
                        </td>
                        <th>拼音简码：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.NameLetter" style="width: 100px;" />
                            <a href="javascript:void(0)" ms-click="onNameChange" style="color: #016b96;">生成</a>
                        </td>
                    </tr>
                    <tr>
                        <th>仓库地址：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.Address" style="width: 180px;" />
                            <button class="myfbt" type="button" ms-click='markInMap'>
                                <i class="imark"></i>地图标注</button>
                        </td>
                        <th>联系电话：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.Tel" style="width: 100px;" />
                        </td>
                    </tr>
                    <tr>
                        <th>备注：
                        </th>
                        <td colspan="3">
                            <input type="text" ms-duplex="entity.Remark" style="width: 462px;" />
                        </td>
                    </tr>
                    <tr>
                        <th>启用多仓位：
                        </th>
                        <td colspan="3">
                            <input type="checkbox" ms-duplex-radio="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="50%" align="center" bgcolor="#FFFFFF">仓位名称
                    </td>
                    <td width="10%" align="center" bgcolor="#FFFFFF">操作
                    </td>
                </tr>
                <tbody>
                    <tr ms-repeat-item="spaceList">
                        <td bgcolor="#FFFFFF">
                            <input type="text" ms-duplex="item.No" style="width: 90%; margin-bottom: 3px; text-align: center;">
                        </td>
                        <td bgcolor="#FFFFFF">
                            <input type="text" ms-duplex="item.Name" 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="removeSpace($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="addSpace">+&nbsp;新增一行</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </noscript>

    <!--查看-->
    <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>
