<template>
  <tab-button v-ref:list :active="-1">
    <tabs header="安检结果查询" v-if="permission('安检查询')">
      <paper-main v-if="show.includes('安检结果查询')" @deal-msg="dealMsg" v-ref:papermain></paper-main>
    </tabs>
    <tabs header="安检员汇总查询" v-if="permission('安检员汇总查询')">
        <check-count-area-manage v-if="show.includes('安检员汇总查询')" @deal-msg="dealMsg"></check-count-area-manage>
    </tabs>
    <tabs header="隐患查询" v-if="permission('隐患查询')">
        <defect-main v-if="show.includes('隐患查询')" @deal-msg="dealMsg" ></defect-main>
    </tabs>
    <tabs header="差值明细查询" v-if="permission('差值明细查询')">
        <paper-chazhi-main v-if="show.includes('差值明细查询')" @deal-msg="dealMsg" ></paper-chazhi-main>
    </tabs>
    <tabs header="隐患明细查询" v-if="permission('隐患明细查询')">
        <paper-defect-main v-if="show.includes('隐患明细查询')" @deal-msg="dealMsg" ></paper-defect-main>
    </tabs>
    <tabs header="安检汇总查询" v-if="permission('安检汇总查询')">
        <check-plan-area-manage v-if="show.includes('安检汇总查询')" @deal-msg="dealMsg" ></check-plan-area-manage>
    </tabs>
    <tabs header="用户安检情况查询" v-if="permission('用户安检情况查询')">
        <check-paper-search-user v-if="show.includes('用户安检情况查询')" @deal-msg="dealMsg" ></check-paper-search-user>
    </tabs>
    <tabs header="隐患报表" v-if="permission('隐患报表')">
        <hiddensituation v-if="show.includes('隐患报表')" @deal-msg="dealMsg" ></hiddensituation>
    </tabs>
    <tabs header="安检率报表" v-if="permission('安检率报表')">
        <safeplansale v-if="show.includes('安检率报表')" @deal-msg="dealMsg" ></safeplansale>
    </tabs>
    <tabs header="安检情况报表" v-if="permission('安检情况报表')">
      <safeplanstatistics v-if="show.includes('安检情况报表')" @deal-msg="dealMsg"></safeplanstatistics>
    </tabs>
  </tab-button>

</template>

<script>
import TabButton from '../common/TabButton'
import Tabs from '../common/Tabs'
// import { HttpResetClass } from 'vue-client'

export default {
  name: 'SafeCheckManage',
  title: '安检查询',
  data() {
    return {// 页面开关
      residentialArea: [],
      f_start_date: '',
      f_end_date: '',
      listpage: true,
      width: {
        left: '100%',
        right: '0%'
      },
      rowData: {},
      show: []
    }
  },
  components: {Tabs, TabButton},
  ready() {
    //tag
    //tag
    //tag
    this.$refs.list.handleTabListClick(0,this.$refs.list.renderData[0])
  },
  methods: {
    permission(name) {
        if (!this.$login.r.find(value => value == name)) {
          return true
      }
      return true
    },
    cancel(obj) {
      this.listpage = true
    },
    dealMsg(obj) {
      this.rowData = obj
      this.listpage = false
      this.f_start_date = obj.model.startDate
      this.f_end_date = obj.model.endDate
    }
  }
}
</script>

<style scoped>

</style>
