<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <!--Header S-->
    <style>
        tbody tr td { cursor: pointer; }
        tr.selected td { background-color: #fffa00 !important; }
    </style>
    <!--Header E-->
</head>
<body>
    <!--Content S-->
    <div class="x_panel">
        <div class="x_content top_search">
            <input type="text" name="keyword" class="form-control keyword" v-model="query.keyword" placeholder="姓名、電話、地址(輸入關鍵字查詢)"
                   @change="query.keyword=$event.target.value" @keypress="keychange($event);" />

            <div class="group-btn">
                <button class="btn btn-success" @click="getList(1);">搜尋</button>&nbsp;
                <button class="btn btn-primary" @click="clearCriteria();">清除條件</button>
            </div>
        </div>
    </div>
    <table border="0" cellpadding="5" cellspacing="1" class="table table-striped jambo_table">
        <thead>
            <tr>
                <td class="col-md-1 text-center">選擇</td>
                <td class="col-md-2">訂單編號</td>
                <td class="col-md-2">承租人</td>
                <td class="col-md-2">使用人</td>
                <td class="col-md-2">手機</td>
                <td class="col-md-3">運送地址</td>
            </tr>
        </thead>
        <tbody >
            <tr v-for="(item, idx) in list" :class="{'selected': checkedIdx == idx}">
                <td @click="selected(item, idx);" class="text-center"><input type="radio" name="address" :checked="checkedIdx == idx" /></td>
                <td @click="selected(item, idx);">{{item.orderNum}}</td>
                <td @click="selected(item, idx);">{{item.tenantName}}</td>
                <td @click="selected(item, idx);">{{item.delivery.receiver}}</td>
                <td @click="selected(item, idx);">{{item.delivery.mobile}}</td>
                <td @click="selected(item, idx);">{{item.delivery.county}}{{item.delivery.city}}{{item.delivery.address}}</td>
            </tr>
            <tr v-show="list == null || list.length == 0">
                <td colspan="6" 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>
    <div class="footer-action">
        <h4>操作：</h4>
        <a class="btn btn-success btn-lg" @click="confirmAddress()">確定</a>
        <a class="btn btn-info btn-lg" @click="closeAndReloadParent()">關閉</a>
    </div>
    <!--Content E-->
    <!--FinalScript S-->
    <script src="_orderAddress.js" type="module"></script>
    <!--FinalScript E-->
</body>
</html>