<template>
    <normalLayout>
      <div class="container" slot="content">
        <!-- <el-button class="normal-margin" type="primary" size="small">编 辑</el-button> -->
<!--        <editInfo class="normal-margin" :data="enterpriseInfo" :btnType="'primary'" btnSize="small" :hideGrade="true" @onSuccess="enterpriseData"></editInfo>-->
        <el-descriptions class="normal-margin" :labelStyle="{width:'120px'}" title="" :column="2" size="medium" border>
          <el-descriptions-item>
            <template slot="label">
              企业名称
            </template>
            {{enterpriseInfo.enterprisename ? enterpriseInfo.enterprisename : '--'}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              企业简称
            </template>
            {{enterpriseInfo.abbreviation ? enterpriseInfo.abbreviation : '--'}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              联系人
            </template>
            {{enterpriseInfo.contact ? enterpriseInfo.contact : '--'}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              联系电话
            </template>
            {{enterpriseInfo.phonenumber ? enterpriseInfo.phonenumber : '--'}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              地址
            </template>
            {{enterpriseInfo.province}}{{enterpriseInfo.city}}{{enterpriseInfo.county}}{{enterpriseInfo.address}}
          </el-descriptions-item>
        </el-descriptions>
        <el-tabs v-if="show" v-model="activeName">
          <el-tab-pane label="收货地址" name="first">
            <setAddress :mainData="enterpriseInfo"></setAddress>
          </el-tab-pane>
          <el-tab-pane label="财务信息" name="second">
            <financial :mainData="enterpriseInfo"></financial>
          </el-tab-pane>
        </el-tabs>
      </div>
    </normalLayout>
</template>

<script>
import financial from '@/components/financialInfo/index.vue'
import setAddress from './modules/address/list.vue'
import editInfo from '@/Form/EnterpriseArchives/edit.vue'
export default {
  data () {
    return {
      activeName:'first',
      enterpriseInfo:{},
      show:false,
      userInfo:''
    }
  },
  components:{
    financial,
    setAddress,
    editInfo
  },
  methods:{
    async enterpriseData () {
      const res = await this.$api.requested({
        "id": 20221022165203,
        "content": {
          sys_enterpriseid:this.userInfo.agent.sys_enterpriseid
        }
      })
      this.enterpriseInfo = res.data
      this.show = true
    },
    //获取用户信息
    async getUserInfo() {
      let res = await this.$api.requested({
        "classname": "common.usercenter.usercenter",
        "method": "queryUserMsg",
        "content": {
        }
      })
      this.userInfo = res.data
      this.enterpriseData()
      console.log(this.userInfo);
      
    },
  },
  created () {
    this.getUserInfo()
  },
  mounted () {
  }
}

</script>
<style>
</style>
<style scoped>
.label-width{
  width: 120px;
}
</style>