<template>
  <basic-container>
    <el-tabs type="border-card" @tab-click="handleClick">
      <el-tab-pane v-if="permission.keypwd_view" label="網點鎖匙/密碼/實物交接登記表" name="keypwd">
        <div v-if="activeTab == 'keypwd'">
          <init-keypwd></init-keypwd>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.sealhandover_view" label="業務印章交接登記表" name="sealhandover">
        <div v-if="activeTab == 'sealhandover'">
          <init-sealhandover></init-sealhandover>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.postchange_view" label="網點出納主管及專管員崗位變更記錄表" name="postchange">
        <div v-if="activeTab == 'postchange'">
         <init-postchange></init-postchange>
        </div>
      </el-tab-pane>

      <el-tab-pane v-if="permission.checkwarehouse_view" label="查庫流水賬記錄表" name="checkwarehouse">
        <div v-if="activeTab == 'checkwarehouse'">
          <init-checkwarehouse></init-checkwarehouse>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.checklist_view" label="每日每週每月核對記錄表" name="checklist">
        <div v-if="activeTab == 'checklist'">
          <init-checklist></init-checklist>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.tellertrunk_view" label="櫃員尾箱檢查流水賬記錄表" name="tellertrunk">
        <div v-if="activeTab == 'tellertrunk'">
          <init-tellertrunk></init-tellertrunk>
        </div>
      </el-tab-pane>

      <el-tab-pane v-if="permission.goodsuse_view" label="網點各項憑證/實物使用及出入庫" name="goodsuse">
        <div v-if="activeTab == 'goodsuse'">
          <init-goodsuse></init-goodsuse>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.returns_view" label="新開戶退件登記表" name="returns">
        <div v-if="activeTab == 'returns'">
          <init-returns></init-returns>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.cardswallow_view" label="自助設備吞卡資料" name="cardswallow">
        <div v-if="activeTab == 'cardswallow'">
          <init-cardswallow></init-cardswallow>
        </div>
      </el-tab-pane>
      <el-tab-pane v-if="permission.message_view" label="信息發佈" name="message">
        <div v-if="activeTab == 'message'">
          <init-message></init-message>
        </div>
      </el-tab-pane>
    </el-tabs>
  </basic-container>
</template>

<script>
  import {mapGetters} from "vuex";
  import InitPostchange from "../../components/initiated/init-postchange";
  import InitGoodsuse from "../../components/initiated/init-goodsuse";
  import InitReturns from "../../components/initiated/init-returns";
  import InitCardswallow from "../../components/initiated/init-cardswallow";
  import InitMessage from "../../components/initiated/init-message";
  import InitKeypwd from "../../components/initiated/init-keypwd";
  import InitSealhandover from "../../components/initiated/init-sealhandover";
  import InitCheckwarehouse from "../../components/initiated/init-checkwarehouse";
  import InitChecklist from "../../components/initiated/init-checklist";
  import InitTellertrunk from "../../components/initiated/init-tellertrunk";

  export default {
    components: {
      InitTellertrunk,
      InitChecklist,
      InitCheckwarehouse,
      InitSealhandover, InitKeypwd, InitMessage, InitCardswallow, InitReturns, InitGoodsuse, InitPostchange},
    data() {
      return {
        activeTab: "keypwd",
        data: []
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    mounted() {
      this.$nextTick(() => {
        document.getElementById("tab-keypwd").click();
      })
    },
    methods: {
      handleClick(tab, event) {
        this.activeTab = tab.name;
      }
    }
  };
</script>

<style>
</style>
