<div ms-controller="ProductStorageCheck">
    <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>
                </td>
                <!--End leftNav-->
                <td width="10">&nbsp;</td>
                <td valign="top" bgcolor="#FFFFFF" height="1" style="vertical-align: top; width: 198px;">
                    <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)" class="setico" ms-click="typeManage" style="float: right;" title="类别管理"></a>
                                        仓库列表
                                    </h2>
                                    <ul id="storageTypeTree" class='ztree' ms-widget="productCategoryTree,storageTypeTree,storageTypeTreeOpts" style="width: 198px; 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;">
                                        <strong class="forange" style="font-size: large"> 时间段从：</strong>
                                        <input type="text" name="StartDate" id="StartDate" ms-duplex="queryData.starttime.val" class="chaoboDate" ms-widget='date,StartDate,dateOpts' style="width: 80px" />
                                        <strong class="forange" style="font-size: large"> - </strong>
                                        &nbsp;&nbsp;&nbsp;
                                        <input type="text" name="EndDate" id="EndDate" class="chaoboDate"  ms-duplex="queryData.endtime.val" style="width: 80px" ms-widget='date,EndDate,dateOpts' />
                                        <input class="input" type="text" ms-duplex="queryData.keyword.val" placeholder="请输入盘点编号、盘点标题、产品名称等关键字" ms-keyup="onEnter">
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="doSearch">搜索</button>
                                        <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clear">显示全部</button>
                                    </div>
                                </td>
                                <td class="fgray"></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, $val.label + ":" + r.label)' 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="dobtn" style="background-color: rgba(0, 0, 0, 0);">
                                <td colspan="12">
                                    <a ms-if="ADD" class="doadd" href="javascript:void(0)" data-permission="ADD" ms-click="doadd">{{lang.AddBtn}}</a>
                                </td>
                            </tr>
                            <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                                <td align="center">盘点编号</td>
                                <td align="center">盘点名称</td>
                                <td align="center">产品种类</td>
                                <td align="center">系统库存</td>
                                <td align="center">实际库存</td>
                                <td align="center">库存总差异</td>
                                <td align="center">盘点报盈</td>
                                <td align="center">盘点报亏</td>
                                <td align="center">盘点持平</td>
                                <td align="center">盘点时间</td>
                                <td align="center">盘点负责人</td>
                                <td align="center">{{lang.Operate}}</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr align="center" ms-repeat-item="grid1.list">
                                <td>
                                    <a href="javascript:void(0)" ms-click="doview(item.Id)">{{item.InventoryNo}}</a>
                                </td>
                                <td>
                                    <a href="javascript:void(0)" ms-click="doview(item.Id)">{{item.InventoryName}}</a>
                                </td>
                                <td>{{item.ProductNumber}}</td>
                                <td>{{item.AccountNumber}}</td>
                                <td>{{item.RealNumber}}</td>
                                <td>
                                    <span ms-if="item.Differences < 0" class="fred">{{item.Differences}}</span>
                                    <span ms-if="item.Differences >= 0">{{item.Differences}}</span>
                                </td>
                                <td>{{item.Profit}}</td>
                                <td>
                                    <span ms-if="item.Loss > 0" class="fred">{{item.Loss}}</span>
                                    <span ms-if="item.Loss <= 0">{{item.Loss}}</span>
                                </td>
                                <td>{{item.Flat}}</td>
                                <td>{{item.ActionTime}}</td>
                                <td>{{item.ActionBy.FullName}}</td>
                                <td>
                                    <a ms-attr-title="lang.ViewBtn" href="javascript:void(0)" ms-click="doview(item.Id)" class="doview"></a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="12" ms-widget='paging,ProductStorageCheckListPage,listOpts'></td>
                            </tr>
                        </tfoot>
                    </table>

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

    <!--新增盘点记录-->
    <noscript id="formTemplate">
        <div class="tabContent2">
            <table width="98%" cellspacing="2" cellpadding="0" border="0" class="commontable">
                <tbody>
                    <tr>
                        <th style="width:80px;">盘点标题：</th>
                        <td style="width:240px;">
                            <input type="text" ms-duplex="entity.InventoryName" style="width: 200px;">
                        </td>
                        <th style="width:100px;">经办人：</th>
                        <td>
                            <input type="text" ms-value="entity.ActionBy.FullName" readonly="readonly" style="width: 100px;">
                            <button type="button" class="myfbt" ms-click='selectActionBy()'><i class="iadduser"></i></button>
                        </td>
                    </tr>
                    <tr>
                        <th>盘点备注：</th>
                        <td colspan="3">
                            <input type="text" ms-duplex="entity.Remark" style="width:470px;" />
                        </td>
                    </tr>
                </tbody>
            </table>
            <table ms-if="ADD" border="0" cellspacing="0" cellpadding="0" class="tableList" style="width:100%;border:1px #d2d2d2 solid;border-width:1px 1px 0px 1px;">
                <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0);">
                    <td>
                        <a class="doadd" href="javascript:void(0)" data-permission="ADD" ms-click="selectProduct">选择盘点产品</a>
                    </td>
                </tr>
            </table>
            <table width="98%" border="0" cellspacing="1" cellpadding="0" class="tableList tableinput bottom10">
            <tr class="head">
                <td align="center" bgcolor="#FFFFFF">盘点仓库</td>
                <td align="center" bgcolor="#FFFFFF">盘点仓位</td>
                <td align="center" bgcolor="#FFFFFF">产品类别</td>
                <td align="center" bgcolor="#FFFFFF">产品名称</td>
                <td align="center" bgcolor="#FFFFFF">产品型号</td>
                <td align="center" bgcolor="#FFFFFF">单位</td>
                <td align="center" bgcolor="#FFFFFF">系统库存</td>
                <td align="center" bgcolor="#FFFFFF">实际库存</td>
                <td align="center" bgcolor="#FFFFFF">盘盈盘亏</td>
                <td align="center" bgcolor="#FFFFFF">操作</td>
            </tr>
            <tbody>
                <tr ms-repeat-item="inlist">
                    <td align="center" bgcolor="#FFFFFF">{{item.StorageName}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.SpaceName}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.ProductCategory}}</td>
                    <td align="center" bgcolor="#FFFFFF" ms-title="item.ProductName">{{item.ProductName|truncate(10,"…")}}</td>
                    <td align="center" bgcolor="#FFFFFF" ms-title="item.Standard">{{item.Standard|truncate(4,"…")}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.Units}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.AccountNumber}}</td>
                    <td style="text-align:center; background:#FFF; width:80px;">
                        <input type="text" style="text-align:center;" ms-duplex="item.RealNumber" />
                    </td>
                    <td align="center" bgcolor="#FFFFFF">{{item.Differences}}</td>
                    <td align="center" bgcolor="#FFFFFF">
                        <a  title="删除" href="javascript:void(0)" ms-click="remove($index)" class="dodel"></a>
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </noscript>

    <!--查看盘点详情-->
    <noscript id="viewTemplate">
        <div class="tabContent2">
            <table width="98%" cellspacing="1" cellpadding="2" border="0" class="tablecInfo" ms-if="storagecheck" ms-repeat-item="storagecheck">
                <tbody>
                    <tr>
                        <td>盘点编号</td>
                        <td>{{item.InventoryNo}}</td>
                        <td>盘点标题</td>
                        <td>{{item.InventoryName}}</td>
                        <td>产品种类</td>
                        <td>{{item.ProductNumber}}</td>
                    </tr>
                    <tr>
                        <td>系统库存</td>
                        <td>{{item.AccountNumber}}</td>
                        <td>实际库存</td>
                        <td>{{item.RealNumber}}</td>
                        <td>库存总差异</td>
                        <td>
                            <span ms-if="item.Loss > 0" class="fred">{{item.Differences}}</span>
                            <span ms-if="item.Loss <= 0">{{item.Differences}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td>盘点报盈</td>
                        <td>{{item.Profit}}</td>
                        <td>盘点报亏</td>
                        <td>
                            <span ms-if="item.Loss > 0" class="fred">{{item.Loss}}</span>
                            <span ms-if="item.Loss <= 0">{{item.Loss}}</span>
                        </td>
                        <td>盘点持平</td>
                        <td>{{item.Flat}}</td>
                    </tr>
                    <tr>
                        <td>盘点时间</td>
                        <td>{{item.ActionTime}}</td>
                        <td>盘点负责人</td>
                        <td>{{item.ActionByName}}</td>
                        <td>盘点部门</td>
                        <td>{{item.ActionByGroup}}</td>
                    </tr>
                    <tr>
                        <td>调拨备注</td>
                        <td colspan="5">{{item.Remark}}</td>
                    </tr>
                </tbody>
            </table>
            <div style=" height:10px; overflow:hidden;"></div>
            <table width="98%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10">
            <tr class="head">
                <td align="center" bgcolor="#FFFFFF">仓库</td>
                <td align="center" bgcolor="#FFFFFF">仓位</td>
                <td align="center" bgcolor="#FFFFFF">产品分类</td>
                <td align="center" bgcolor="#FFFFFF">产品名称</td>
                <td align="center" bgcolor="#FFFFFF">产品型号</td>
                <td align="center" bgcolor="#FFFFFF">系统库存</td>
                <td align="center" bgcolor="#FFFFFF">实际库存</td>
                <td align="center" bgcolor="#FFFFFF">盘点盈亏</td>
                <td align="center" bgcolor="#FFFFFF">盘点负责人</td>
            </tr>
            <tbody>
                <tr ms-repeat-item="showlist">
                    <td align="center" bgcolor="#FFFFFF">{{item.StorageName}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.SpaceName}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.ProductCategory}}</td>
                    <td align="center" ms-title="item.ProductName">{{item.ProductName|truncate(10,"…")}}</td>
                    <td align="center" ms-title="item.Standard">{{item.Standard|truncate(4,"…")}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.AccountNumber}}</td>
                    <td align="center" bgcolor="#FFFFFF">{{item.RealNumber}}</td>
                    <td align="center" bgcolor="#FFFFFF">
                        <span ms-if="item.Differences < 0" class="fred">{{item.Differences}}</span>
                        <span ms-if="item.Differences >= 0">{{item.Differences}}</span>
                    </td>
                    <td align="center" bgcolor="#FFFFFF">{{item.ActionByName}}</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="10" ms-widget='paging,StorageInventoryListPage,listOpts'></td>
                </tr>
            </tfoot>
            </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>
