<template>
  <div class="tabsReportList-wrap">
    <div style="background-color: #fff;margin-bottom: 5px;">
      <a-tabs default-active-key="1" v-model="curTab">
        <a-tab-pane key="1" tab="销售报表" v-if="$hasPermissions('M_salesReportList')"></a-tab-pane>
        <a-tab-pane key="2" tab="销售明细报表" v-if="$hasPermissions('M_salesDetailReportList')" force-render></a-tab-pane>
      </a-tabs>
    </div>
    <a-card size="small" :bordered="false">
      <salesReport v-show="curTab==1&&$hasPermissions('M_salesReportList')"></salesReport>
      <salesDetailReport v-show="curTab==2&&$hasPermissions('M_salesDetailReportList')"></salesDetailReport>
    </a-card>
  </div>
</template>

<script>
import salesReport from './list.vue'
import salesDetailReport from '@/views/reportData/salesDetailReport/list.vue'
export default {
  name: 'SalesReportIndex',
  components: {
    salesReport,
    salesDetailReport
  },
  data () {
    return {
      curTab: '1'
    }
  }
}
</script>

<style lang="less">
  .tabsReportList-wrap{
    display: flex;
    flex-direction: column;
    height: 100%;
    .ant-tabs-bar{
      margin: 0;
    }
    .ant-card{
      flex-grow: 1;
      overflow: auto;
    }
  }
</style>
