<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <!--Content S-->
    <div v-show="memberObj.marketId <= 0" class="col-md-4 col-sm-6 col-xs-12">
        <div class="top_search">
            <div class="autocomplete">
                <input type="search" id="query-market" class="form-control" placeholder="= 代工通路 =" />
                <div style="display: none">
                    <input type="text" v-model="query.oemMarketId" />
                    <input type="text" v-model="query.oemMarketName" />
                </div>
            </div>
            <div class="group-btn">
                <button class="btn btn-success" @click="getList();">搜尋</button>&nbsp;
            </div>
        </div>
    </div>
    <div :class="[memberObj.marketId <= 0 ? 'col-md-8 col-sm-6 col-xs-12':'col-md-12 col-sm-12 col-xs-12']">
        <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>
    <table border="0" cellpadding="5" cellspacing="1" class="table table-striped jambo_table">
        <thead>
            <tr>
                <td v-show="memberObj.marketId <= 0">通路</td>
                <td></td>
                <td></td>
                <td>輔具</td>
                <td>尺寸</td>
                <td>產編</td>
                <td>說明</td>
                <td>通知時間</td>
                <td v-show="memberObj.name == 'Reiko'"></td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="(item, index) in list">
                <td class="small" v-show="memberObj.marketId <= 0">{{item.marketName.substring(0, 4)}}</td>
                <td class="text-center">
                    <a class="btn btn-success" v-if="item.enStockStatus == 600" @click="confirm(item)">轉清消</a>
                    <a class="btn btn-warning" v-if="item.enStockStatus == 750" @click="confirm(item)">轉</a>
                    <a class="btn btn-danger" v-if="item.enStockStatus == 5100" @click="confirm(item)">轉售出</a>
                    <a class="btn btn-danger" v-if="item.enStockStatus == 9900" @click="confirm(item)">轉報廢</a>
                </td>
                <td><img :src="item.coverImage" v-if="item.coverImage != null && item.coverImage.length > 0" /></td>
                <td>{{item.productCode}}</td>
                <td>{{item.seatWidthAttrName}}</td>
                <td><a :href="'/oem/product/_stocklog?id=' + item.stockId + '&mid=' + item.productId" class="iframe">{{item.propertyNo}}</a></td>
                <td><div v-if="item.eventLogMemo != null" v-html="item.eventLogMemo.replace(/\n/g,'<br />')"></div></td>
                <td>{{item.lastEventDatetime}}</td>
                <td v-show="memberObj.name == 'Reiko'">
                    <a class="btn btn-primary" v-if="item.enStockStatus == 600" @click="release(item)">不清消, 轉可租用</a>
                </td>
            </tr>
            <tr v-show="list == null || list.length == 0">
                <td colspan="8" class="text-center">No Data.</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>
    <!--Content E-->
    <!--FinalScript S-->
    <script src="confirm.js" type="module"></script>
    <!--FinalScript E-->
</body>
</html>