<template>
  <div class="app-container">

    <div class="info">
      <div class="avatar">
        <img src="~@/assets/system/systemAvatar.svg" alt="">
        <span>{{ form.orgName}}</span>
      </div>
      <div class="title">企业信息</div>
      <el-form ref="form" :model="form" label-width="120px" label-position="left">
        <el-row :gutter="20">
          <el-col :span="11">
            <el-form-item label="粮库名称">
              <el-input v-model="form.orgName"></el-input>
            </el-form-item>
            <el-form-item label="行业">
              <el-input v-model="form.orgTrade"></el-input>
            </el-form-item>
            <el-form-item label="联系人">
              <el-input v-model="form.orgContacts"></el-input>
            </el-form-item>
            <el-form-item label="所在地区">
              <el-input v-model="form.orgArea"></el-input>
            </el-form-item>
            <el-form-item label="企业简介">
              <el-input v-model="form.orgIntroduction"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11" :offset="2">
            <el-form-item label="识别码">
              <el-input v-model="form.orgCode"></el-input>
            </el-form-item>
            <el-form-item label="企业规模">
              <el-input v-model="form.orgScale"></el-input>
            </el-form-item>
            <el-form-item label="邮政编码">
              <el-input v-model="form.zipCode"></el-input>
            </el-form-item>
            <el-form-item label="详细地址">
              <el-input v-model="form.detailedAddress"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts';
import { getUserInfo } from '@/api/system/index.js'
export default {
  data () {
    return {
      form: {
        orgName: '黛西进出口贸易公司',
        orgTrade: 'GS8392',
        orgContacts: '1000-9999人',
        orgArea: '-',
        orgIntroduction: '互联网、新媒体和高科技产业/电商',
        orgCode: '蔡清淑',
        orgScale: '浙江省>杭州市',
        zipCode:'-',
        detailedAddress:'-'
      },
      userInfo:null,
    }
  },
  created () {
    // console.log(this.$route.query, 'query')
    this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
  },
  mounted () {
    this.getInfo()
    console.log(this.userInfo,'userInfo')
  },
  methods: {
    tableDataAdd () {
      // this.tableData.
    },
    getInfo() {
      getUserInfo(this.userInfo.userName).then(res => {
        console.log(res,'userinfo')
        if(res.code == 200) {
          console.log(res,'用户信息')
          this.form = res.data
        }
      }).catch(err =>{
        console.log(err)
      })
    }
  }
}
</script>
<style lang='scss' scoped>
.info {
  background-color: #fff;
  border-radius: 15px;
  padding: 10px 15px;
  height: calc(100vh - 110px);
  .avatar {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
  }
  .title {
    border-left: 4px solid #4a7de6;
    padding-left: 10px;
  }
  .el-form {
    margin-top: 15px;
    padding: 15px;
  }
}
.table {
  border-radius: 0.185185rem;
}
.th {
  height: 1.074074rem;
  line-height: 1.074074rem;
  background-color: #1d9eef;
  text-align: center;
  // border: 1px solid #000;
}
.list-tr {
  height: 1.074074rem;
  line-height: 1.074074rem;
  border: 1px solid #000;
}
td {
  text-align: center;
}
::v-deep .el-input__inner {
  text-align: center;
}
</style>
