<template>
  <div v-loading="loading" class="addContact">
    <div class="head-title">
      <span @click="CommonJump('companyList')" class="blue point">公司资料管理</span> / 公司资料详情
    </div>
    <div class="content">
      <el-form :model="addMsg"  ref="addMsg" label-width="150px" style="width:60%">
        <el-form-item label="公司名称" class="is-required">
          <el-input v-model="addMsg.CompanyName" disabled class="w400" />
        </el-form-item>
        <el-form-item label="英文名称">
          <el-input v-model="addMsg.CompanyEnName" disabled class="w400" />
        </el-form-item>
        <el-form-item label="联系人" class="is-required">
          <el-input v-model="addMsg.Principal" disabled class="w400" />
        </el-form-item>
        <el-form-item label="联系电话" class="is-required">
          <el-input v-model="addMsg.Mobile" disabled class="w400" />
        </el-form-item>
        <el-form-item label="邮箱" class="is-required">
          <el-input v-model="addMsg.EMail" disabled class="w400" />
        </el-form-item>
        <el-form-item label="法人">
          <el-input v-model="addMsg.LegalPerson" disabled class="w400" />
        </el-form-item>
        <el-form-item label="公司微信">
          <el-input v-model="addMsg.WechatNo" disabled class="w400" />
        </el-form-item>
        <el-form-item label="公司介绍">
          <el-input type="textarea" :rows="3" v-model="addMsg.CompanyIntro" disabled class="w400" size="small" />
        </el-form-item>
        <el-form-item label="公司官网">
          <el-input v-model="addMsg.DomainUrl" disabled class="w400" />
        </el-form-item>
        <el-form-item label="成立时间">
          <el-input v-model="addMsg.FoundingTime" disabled class="w400" />
        </el-form-item>
        <el-form-item label="员工人数">
          <el-input v-model="addMsg.EmployeeNum" disabled class="w400" />
        </el-form-item>
        <el-form-item label="年销售(万元)">
          <el-input v-model="addMsg.AnnualSales" disabled class="w400" />
        </el-form-item>
        <el-form-item label="年进口额(万元)">
          <el-input v-model="addMsg.AnnualImport" disabled class="w400" />
        </el-form-item>
        <el-form-item label="详细地址">
          <el-input v-model="addMsg.Address" disabled class="w400" />
        </el-form-item>
        <el-form-item label="英文地址">
          <el-input v-model="addMsg.EnAddress" disabled class="w400" />
        </el-form-item>
        <el-form-item label="行业">
          <el-input v-model="addMsg.Industry" disabled class="w400" />
        </el-form-item>
        <el-form-item label="出口国">
          <el-input v-model="addMsg.ExportCountry" disabled class="w400" />
        </el-form-item>
        <el-form-item label="进口国家">
          <el-input v-model="addMsg.ImportCountry" disabled class="w400" />
        </el-form-item>
        <el-form-item label="进口品目">
          <el-input v-model="addMsg.ImportCategory" disabled class="w400" />
        </el-form-item>
        <el-form-item label="其他内容">
          <el-input type="textarea" :rows="3" v-model="addMsg.OtherInfo" disabled class="w400" size="small" />
        </el-form-item>
      </el-form>
    </div>
    <div style="margin-top:20px">
      <el-button size="small" type="primary" @click="CommonJump('companyList')">返回</el-button>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        addMsg: {
          CompanyId: 0, //编号
          CompanyName: "", //公司名称
          CompanyEnName: "", //公司英文名称
          Principal: "", //联系人
          Mobile: "", //联系电话
          EMail: "", //邮箱
          LegalPerson: "", //法人
          WechatNo: "", //公司微信
          CompanyIntro: "", //公司介绍
          DomainUrl: "", //官网
          FoundingTime: "", //成立时间
          EmployeeNum: "", //员工人数
          AnnualSales: "", //年销售(万元)
          AnnualImport: "", //年进口额
          Address: "", //详细地址
          EnAddress: "", //详细地址(英文)
          Industry: "", //行业
          ExportCountry: "", //主要出口国
          ImportCountry: "", //主要进口国家
          ImportCategory: "", //主要进口类目
          OtherInfo: "", //其他内容
        }
      };
    },
    created() {
      if (this.$route.query.Id) {
        this.addMsg.Id = this.$route.query.Id;
        this.getData(this.addMsg.Id)
      }
    },
    methods: {
      getData(ID) {
        this.loading = true;
        this.apipost("/api/Trade/GetCompany", {
          CompanyId: ID
        }, res => {
          this.loading = false;
          if (res.data.data) {
            var tempData = res.data.data;
            this.addMsg.CompanyId = tempData.CompanyId;
            this.addMsg.CompanyName = tempData.CompanyName;
            this.addMsg.CompanyEnName = tempData.CompanyEnName;
            this.addMsg.Principal = tempData.Principal;
            this.addMsg.Mobile = tempData.Mobile;
            this.addMsg.EMail = tempData.EMail;
            this.addMsg.LegalPerson = tempData.LegalPerson;
            this.addMsg.WechatNo = tempData.WechatNo;
            this.addMsg.CompanyIntro = tempData.CompanyIntro;
            this.addMsg.DomainUrl = tempData.DomainUrl;
            this.addMsg.FoundingTime = tempData.FoundingTimeStr;
            this.addMsg.EmployeeNum = tempData.EmployeeNum;
            this.addMsg.AnnualSales = tempData.AnnualSales;
            this.addMsg.AnnualImport = tempData.AnnualImport;
            this.addMsg.Address = tempData.Address;
            this.addMsg.EnAddress = tempData.EnAddress;
            this.addMsg.Industry = tempData.Industry;
            this.addMsg.ExportCountry = tempData.ExportCountry;
            this.addMsg.ImportCountry = tempData.ImportCountry;
            this.addMsg.ImportCategory = tempData.ImportCategory;
            this.addMsg.OtherInfo = tempData.OtherInfo;
          }
        })
      },
    },
    mounted() {}
  };

</script>
<style>
  .addContact .tip {
    margin-left: 10px;
    display: inline-block;
    height: 30px;
    line-height: 30px;
    color: #ff4544;
    background-color: #FEF0F0;
    padding: 0 20px;
    border-radius: 5px;
  }

  .addContact .app-image {
    background-size: cover;
    background-position: center center;
    width: 80px;
    height: 80px;
    border-radius: 0%;
  }

  .addContact .setTable .el-table__body .cell {
    display: flex;
    align-items: center;

  }

  .addContact .commonLabel .el-form-item__label {
    margin-top: -4px;
  }

  .addContact .discount .el-form-item__label {
    padding-right: 30px;
    margin-top: -4px;
  }

  .addContact .el-form-item .elzk {
    position: absolute;
    left: -25px;
    top: 8px;
  }

  .addContact .el-form-item {
    position: relative;
  }

  .addContact .blue {
    color: #409EFF;

  }

  .addContact .content {
    background: #fff;
    margin-top: 10px;
    padding: 20px;
    box-sizing: border-box;
  }

  .addContact .gez_list {
    width: 650px;
    margin-bottom: 12px;
    padding: 20px;
    border: 1px solid #EBEEF5;
    background-color: #FFF;
    color: #303133;
    display: flex;
    flex-direction: row;
    justify-content: space-between;

  }

  .addContact .quyu {
    background-color: #f4f4f5;
    color: #909399;
    padding: 10px;
    line-height: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    margin: 5px;
  }

  .addContact .imgstyle {
    width: 32px;
    height: 32px;
    margin: 0 5px;
  }

</style>
