<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <!--Header S-->
    <style>
        .span-status { margin-left: 2em; }
    </style>
    <!--Header E-->
</head>
<body>
    <!--Content S-->
    <h3>{{mainObj.name}}</h3>
    <h4>產編：{{stock.propertyNo}}<span class="span-status">{{stock.statusString}}</span></h4>
    <table border="0" cellpadding="5" cellspacing="1" class="table table-striped jambo_table">
        <thead>
            <tr>
                <td>日期</td>
                <td>說明</td>
                <td>狀態</td>
                <td>訂單</td>
                <td>門市/承租人</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="(item, index) in list">
                <td>{{item.createDate}}</td>
                <td>{{item.memo}}</td>
                <td>{{item.statusString}}</td>
                <td>
                    <div v-if="item.orderDeleteDatetime != null" class="small">{{item.orderNum}} <span class="red">(已刪除)</span></div>
                    <div v-else>
                        <a v-if="item.orderMainId > 0" :href="'/order/orderedit?id=' + item.orderMainId" target="_top">{{item.orderNum}}</a>
                        <a v-else :href="'/packing/orderedit?id=' + Math.abs(item.orderMainId)" target="_top">{{item.orderNum}}</a>
                    </div>
                </td>
                <td>
                    <div v-if="item.ownerStoreId == -1">{{item.tenantName}}</div>
                    <div v-else>
                        {{item.storeName}}
                        <div class="small" v-if="item.enRentedFor == 100">{{item.tenantName}}</div>
                        <div class="small" v-else-if="item.enRentedFor == 200">門市展示</div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <div v-if="pager != null" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
        <div class="row">
            <div class="col-sm-4">
                <div class="dataTables_info">總筆數 {{pager.totalRecord}} 筆, 第 {{pager.startItemIndex}} ~ {{pager.endItemIndex}} 筆</div>
            </div>
            <div class="col-sm-8">
                <div class="dataTables_paginate paging_simple_numbers">
                    <ul class="pagination">
                        <li class="paginate_button previous" v-if="pager.currentPage > 1"><a @click="goPage(1);"><i class="fas fa-angle-double-left"></i></a></li>
                        <li class="paginate_button previous" v-if="pager.currentPage > 1"><a @click="goPage(pager.currentPage - 1 );"><i class="fas fa-angle-left"></i></a></li>

                        <li class="paginate_button" :class="{ active: n == pager.currentPage }" v-for="n in pager.endPage" v-if="n >= pager.startPage">
                            <a @click="goPage(n);">{{n}}</a>
                        </li>

                        <li class="paginate_button next" v-if="pager.totalPage > pager.currentPage"><a @click="goPage(pager.currentPage + 1 );"><i class="fas fa-angle-right"></i></a></li>
                        <li class="paginate_button next" v-if="pager.totalPage > pager.currentPage"><a @click="goPage(pager.totalPage);"><i class="fas fa-angle-double-right"></i></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="footer-action">
        <div class="col-md-12 col-xs-12 text-center">
            <a class="btn btn-info" @click="closeAndReloadParent()">關閉</a>
        </div>
    </div>
    <!--Content E-->
    <!--FinalScript S-->
    <script src="_stocklog.js" type="module"></script>
    <!--FinalScript E-->
</body>
</html>