<template>
  <div class="app-container" v-loading="loading">
    <el-tabs :tab-position="tabPosition">
      <el-tab-pane label="企业自填">
        <el-tabs type="border-card">
          <el-tab-pane label="项目基本信息">
            <!-- <basic-info ref="basicInfo" :projectOwner="'1'" :entOwnVisible="entOwnVisible"></basic-info> -->
            <ent-basic></ent-basic>
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <enclosure :projectOwner="'1'"></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>
            <!-- <basic-info ref="basicInfo" :projectOwner="'2'" :entTechVisible="entTechVisible"></basic-info> -->
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <enclosure :projectOwner="'1'"></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>
            <!-- <basic-info ref="basicInfo" :projectOwner="'3'" :entFinVisible="entFinVisible"></basic-info> -->
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <enclosure :projectOwner="'3'"></enclosure>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>

import BasicInfo from './components/BasicInfo'
import Enclosure from './components/enclosure'
import EntBasic from './components/EntBasic'
import TechBasic from './components/TechBasic'
import FinBasic from './components/FinBasic'
import {getProjectInfoApi} from '@/api/enterprise/project/project'
export default {
  name: "First",
  computed: {
    userType() {
      return this.$store.state.user.userType
    },
  },
  components: {
    BasicInfo,
    Enclosure,
    EntBasic,
    TechBasic,
    FinBasic
  },
  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">

</style>
