<template>
  <div class="app-container" v-loading="loading">
    <el-tabs :tab-position="tabPosition" stretch ref="tabsFirst" v-model="activeName">
      <el-tab-pane label="企业自填" name="1">
        <el-tabs type="border-card">
          <el-tab-pane label="项目基本信息">
            <basic-info :projectOwner="'1'"></basic-info>
          </el-tab-pane>
          <el-tab-pane label="资料附件">
            <enclosure-info :projectOwner="'1'"></enclosure-info>
          </el-tab-pane>
        </el-tabs>
      </el-tab-pane>
      <!-- 用户不是企业管理员 -->
      <!-- <template v-if="userType ! = 'ENT_ADMIN'"> -->
        <el-tab-pane label="企业技术" name="2" v-if="tabVisible">
          <el-tabs type="border-card">
            <el-tab-pane label="项目基本信息">
              <basic-info :projectOwner="'2'"></basic-info>
            </el-tab-pane>
            <el-tab-pane label="资料附件">
              <enclosure-info :projectOwner="'2'"></enclosure-info>
            </el-tab-pane>
          </el-tabs>
        </el-tab-pane>
      <!-- </template> -->
      <!-- <template v-if="userType != 'ENT_ADMIN' || userType != 'ENT_TECH' || userType != 'ENT_ADMIN_TECH'"> -->
        <el-tab-pane label="企业财务" name="3" v-if="finVisible">
          <el-tabs type="border-card">
            <el-tab-pane label="项目基本信息">
              <basic-info :projectOwner="'3'"></basic-info>
            </el-tab-pane>
            <el-tab-pane label="资料附件">
              <enclosure-info :projectOwner="'3'"></enclosure-info>
            </el-tab-pane>
            <el-tab-pane label="财务资料附件">
              <enclosure-info :projectOwner="'3'" :finOwner="'fin'"></enclosure-info>
            </el-tab-pane>
          </el-tabs>
        </el-tab-pane>
      <!-- </template> -->
      <!-- 用户不是企业管理员 技术员 -->

    </el-tabs>
  </div>
</template>

<script>

import BasicInfo from './components/BasicInfo'
import EnclosureInfo from './components/EnclosureInfo'
export default {
  name: "First",
  computed: {
    userType() {
      return this.$store.state.user.userType
    },
  },
  components: {
    BasicInfo,
    EnclosureInfo
  },
  data() {
    return {
      activeName: '1',
      tabPosition: 'left',
      loading: false,
      entOwnVisible: false,
      entTechVisible: false,
      entFinVisible: false,
      id: undefined,
      tabVisible: false,
      finVisible: false
    };
  },
  created() {
    this.id = this.$route.query.id || undefined;
    if(this.userType != 'ENT_ADMIN') {
      this.tabVisible = true
    }
    if(this.userType != 'ENT_ADMIN' || this.userType != 'ENT_TECH' || this.userType != 'ENT_ADMIN_TECH') {
      this.finVisible = true
    }
  }
};
</script>

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