<template>
  <tab-button class="foot_tabset" :active="-1">
    <tabs header="上报查询" v-if="permission('上报查询')">
      <ckh-report-list v-if="show.includes('上报查询')"></ckh-report-list>
    </tabs>
    <tabs header="结算查询" v-if="permission('结算查询')">
      <ckh-report-data-query v-if="show.includes('结算查询')"></ckh-report-data-query>
    </tabs>
    <tabs header="物联网表抄表查询" v-if="permission('物联网表抄表查询')">
      <ckh-web-handplan-query v-if="show.includes('物联网表抄表查询')" @deal-msg="dealMsg" :data="data"></ckh-web-handplan-query>
    </tabs>
  </tab-button>

</template>

<script>
  import TabButton from '../../components/sale/common/TabButton'
  import Tabs from '../../components/sale/common/Tabs'

  export default {
    title: 'CKH物联查询',
    data () {
      return {
        show: []
      }
    },
    components: {Tabs, TabButton},
    methods: {
      permission (name) {
        // 保留是为了后面可能也会和综合查询一样加权限
        if (this.$login.r.find(value => value === '物联查询') || name === '历史指令查询') {
          if (!this.$login.r.find(value => value === name)) {
            return false
          }
        }
        return true
      }
    }
  }
</script>

<style scoped>
</style>
