<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <!--Header S-->
    <style>
        .jambo_table thead a, .jambo_table thead a:link, .jambo_table thead a:visited { color: #ECF0F1; }
        .jambo_table thead a:hover { color: #ffd800; }
        .zipCode { display: none; width: 500px; }
        .zipCode ul li { display: inline-block; width: 33%; }
        td input[type=number] { width: 100%; display: block; }
    </style>
    <!--Header E-->
</head>
<body>
    <!--Content S-->
    <div class="" role="tabpanel" data-example-id="togglable-tabs">
        <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
            <li><a :href="'edit?id=' + store.id">基本資料</a></li>
            <li><a :href="'userlist?sid=' + store.id">門市帳號</a></li>
            <li><a :href="'pricelist?sid=' + store.id">價格</a></li>
            <li class="active"><a :href="'freightlist?sid=' + store.id">運費</a></li>
            <li><a :href="'orderlist?sid=' + store.id">租賃記錄</a></li>
            <li><a :href="'stocklist?sid=' + store.id">輔具動態</a></li>
            <li><a href="list">回列表</a></li>
        </ul>
    </div>
    <div class="col-md-12 col-sm-12 col-xs-12"></div>
    <div class="col-md-4 col-sm-4 col-xs-12">
        <ul class="info">
            <li>
                <span class="title">通路</span>
                <span>{{store.marketName}}</span>
            </li>
            <li>
                <span class="title">門市</span>
                <span>{{store.name}} ({{store.shortName}})</span>
                <a :href="'@printqrcode?id=' + store.id" class="iframe alignright"><i class="fas fa-qrcode fa-lg"></i></a>
            </li>
            <li>
                <span class="title">佳醫代收</span>
                <label class="label label-info" v-if="store.isCodConsumableFee == 1">耗材費</label>
                <label class="label label-default" v-if="store.isCodFreight == 1">運費</label>
                <span v-if="store.isCodConsumableFee == 0 && store.isCodFreight == 0">--</span>
            </li>
        </ul>
    </div>
    <div class="col-md-8 col-sm-8 col-xs-12"></div>
    <div class="col-md-12 col-sm-12 col-xs-12"></div>
    <table border="0" cellpadding="5" cellspacing="1" class="table table-striped jambo_table">
        <thead>
            <tr>
                <td>名稱</td>
                <td class="text-center">上架</td>
                <td v-for="area in ltAreas">
                    {{area.name}}運費 <a :href="'#zipCode' + area.id" class="iframe"><i class="fa fa-question-circle"></i></a>
                    <div :id="'zipCode' + area.id" class="zipCode">
                        <ul>
                            <li v-for="item in area.zipCodes">{{item.zip}} {{item.name}}</li>
                        </ul>
                    </div>
                </td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="(item, index) in list">
                <td>{{item.name}}</td>
                <td class="text-center" :class="'status' + item.status"><span v-if="item.status == 1">是</span><span v-else>否</span></td>
                <td v-for="f in item.freights">
                    <span v-for="area in ltAreas" v-show="f.areaId == area.id">
                        <input type="number" class="form-control" v-model="f.freightage" min="-1" />
                    </span>
                </td>
            </tr>
        </tbody>
        <tfoot v-show="list != null && list.length > 0">
            <tr>
                <td colspan="2"></td>
                <td colspan="3" class="text-center"><a @click="saveAll();" class="btn btn-success btn-sm">儲存所有運費</a></td>
            </tr>
        </tfoot>
    </table>
    <!--Content E-->
    <!--FinalScript S-->
    <script src="freightlist.js" type="module"></script>
    <!--FinalScript E-->
</body>
</html>