<template>
  <div class="app-container" v-loading="loading">
    <el-tabs :tab-position="tabPosition" stretch>
      <el-tab-pane label="企业自填">
        <el-tabs type="border-card">
          <el-tab-pane label="项目基本信息">
            <ent-basic></ent-basic>
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <ent-enclosure></ent-enclosure>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
      <el-tab-pane label="企业技术">
        <el-tabs type="border-card">
          <el-tab-pane label="项目基本信息">
            <tech-basic></tech-basic>
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <tech-enclosure></tech-enclosure>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
      <el-tab-pane label="企业财务">
        <el-tabs type="border-card">
          <el-tab-pane label="项目基本信息">
            <fin-basic></fin-basic>
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <fin-enclosure></fin-enclosure>
          </el-tab-pane>
          <el-tab-pane label="财务资料附件">
            <fin-data-enclosure></fin-data-enclosure>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>

import EntBasic from './components/EntBasic'
import TechBasic from './components/TechBasic'
import FinBasic from './components/FinBasic'
import {getProjectInfoApi} from '@/api/enterprise/project/project'
import EntEnclosure from './components/EntEnclosure'
import FinEnclosure from './components/FinEnclosure'
import TechEnclosure from './components/TechEnclosure'
import FinDataEnclosure from './components/FinDataEnclosure'
export default {
  name: "First",
  computed: {
    userType() {
      return this.$store.state.user.userType
    },
  },
  components: {
    EntBasic,
    TechBasic,
    FinBasic,
    EntEnclosure,
    FinEnclosure,
    TechEnclosure,
    FinDataEnclosure
  },
  data() {
    return {
      tabPosition: 'left',
      loading: false,
      entOwnVisible: false,
      entTechVisible: false,
      entFinVisible: false,
      id: undefined
    };
  },
  created() {
    this.id = this.$route.query.id || undefined;
    //管理员
    if(this.userType == 'ENT_ADMIN') {
      this.entOwnVisible = true
      this.entFinVisible = false
      this.entTechVisible = false
    }else if(this.userType == 'ENT_TECH' || this.userType == 'ENT_ADMIN_TECH') {
      this.entOwnVisible = false
      this.entFinVisible = false
      this.entTechVisible = true
    }else if(this.userType == 'ENT_FIN' || this.userType == 'ENT_ADMIN_FIN') {
      this.entOwnVisible = false
      this.entFinVisible = true
      this.entTechVisible = false
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss">
  .el-tabs__nav {
    width: 96px
  }
</style>
