<template>
  <div class="app-container">
    <div class="header_main">
      查看企业工商户
      <div class="return_btn" @click="onClickLeft"></div>
    </div>
    <div class="jg"></div>
    <div class="main_box">
      <van-cell title="企业名称" :border="false" v-model="form.companyName" />
      <van-cell title="法人/负责人" :border="false" v-model="form.legalName" />
      <van-cell title="所在地区" :border="false" v-model="form.deptId" />
      <van-cell title="统一社会信用代码" :border="false" v-model="form.uniformCode" />
      <van-cell title="手机号码" :border="false" v-model="form.phone" />
      <van-cell title="企业分支机构" :border="false" v-model="form.companyBranch" />
      <van-cell title="企业投资人" :border="false" v-model="form.investor" />
      <van-cell title="详细地址" :border="false" v-model="form.address" />
      <van-cell title="经营类别" :border="false" v-model="form.businessType" />
      <van-cell title="经营方式" :border="false" v-model="form.businessMode" />
      <van-cell title="经营范围" :border="false" v-model="form.businessScope" />
    </div>
    <p class="submitButton" @click="$router.push({name:'lawEnforcementEnterpriseRelation', query: {id:form.id}})">关联案件</p>
  </div>
</template>

<script>
  import { getCompany } from "@/api/lawEnforcement/index";
  export default {
    name: "programmeDetail",
    data() {
      return {
        form:{},
      };
    },
    created() {
      this.getDicts("business_type").then(response => {
        this.businessTypeOptions = response.data;
      });
      this.getDetail(this.$route.query.id)
    },
    methods: {
      getDetail(id){
        var that = this;
        setTimeout(function () {
          getCompany(id).then(response => {
            response.data.businessType = response.data.businessType == '' ? '' : that.selectDictLabel(that.businessTypeOptions, response.data.businessType);
            that.form = response.data;
          });
        },1000)
      },
      goBack(){
        window.history.go(-1)
      }
    },
  }
</script>

<style scoped lang="scss">
  .jg{
    height: 116px;
  }
  .app-container {
    padding: 2% 0;
  }
  /deep/ .van-collapse-item__content{
    padding: 0;
  }
  /deep/ .van-cell{
    padding-bottom: 0;
    padding-top: 0;
    margin-bottom: 10PX;
    &:last-child{
      margin-bottom: 0;
    }
  }
  .cf{
    padding: 0 3%;
    margin-top: 20PX;
    margin-bottom: 20PX;
    .van-row{
      background: #F0F3F5;
      .van-col{
        padding: 5PX 0;
        font-size: 12PX!important;
        text-align: center;
        p{
          color: #1D6FE9;
        }
      }
      &:first-child{
        background: transparent;
      }
    }
  }
  .header_main{
    height: 116px;
    background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
    background-size: 100% 100%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 36px;
    line-height: 116px;
    text-align: center;
    color: #fff;
    z-index: 999;
    .return_btn{
      width: 24px;
      height: 43.2px;
      background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
      background-size: 20px 36px;
      position: absolute;
      left: 38px;
      top: 36px;
    }
    .add_btn{
      width: 56.4px;
      height: 40.8px;
      background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
      background-size: 47px 34px;
      position: absolute;
      right: 38px;
      top: 36px;
    }
  }
  /deep/ .van-radio--horizontal{
    margin-left: 0.32rem;
    margin-right: 0;
  }
  .peopleList{
    padding-right: 3%;
    .van-row{
      margin-bottom: 10PX;
      .van-col{
        text-align: center;
        font-size: 14PX;
      }
      &:first-child{
        .van-col{
          color: #1D6FE9;
        }
      }
    }
  }
  .main_title{
    font-size: 0.4rem;
    color: #1D6FE9;
    margin: 0.2rem 6%;
    margin-top: 0;
    position: relative;
  }
  .main_box{
    width: 96%;
    margin: 0 auto;
    border-radius: 10PX;
    box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
    overflow: hidden;
    background-color: #FFF;
    padding: 10PX 0;
    .van-icon{
      vertical-align: middle;
    }
    .custom-title{
      font-size: 17PX;
      color: #333333;
      vertical-align: middle;
      line-height: 1;
      position: relative;
    }
    .tap{
      color: #1D6FE9;
    }
    .bgBlue{
      display: block;
      position: absolute;
      width: 17PX;
      height: 17PX;
      border-radius: 50%;
      background-color: rgba(29,111,233,0.26);
      top: -2PX;
      right: -8PX;
    }
  }
  .submitButton{
    width: 45%;
    margin: 0 auto;
    background-image: linear-gradient(to right, #2E79E9 , #77A6EF);
    text-align: center;
    color: #ffffff;
    height: 70px;
    line-height: 70px;
    border-radius: 8PX;
    margin-top: 25PX;
  }

  .addFamily{
    position: absolute;
    top: -2px;
    right: 0;
    border-radius: 50%;
  }
</style>
