<template>
  <div>
    <div class="main">
      <div class="cardTitle">企业信息</div>
      <a-divider />
      <div class="content">
        <a-descriptions title="基本信息" :column="3">
          <a-descriptions-item label="企业名称">
            {{infoList.companyName}}
          </a-descriptions-item>
          <a-descriptions-item label="公司地址">
            {{infoList.companyAddressDetails}}
          </a-descriptions-item>
          <a-descriptions-item label="社会信用代码">
            {{infoList.socialCreditCode}}
          </a-descriptions-item>
          <a-descriptions-item label="法人名称"> {{infoList.legalPersonName}} </a-descriptions-item>
          <a-descriptions-item label="法人身份证号"
            >{{infoList.legalPersonIdCard}}</a-descriptions-item
          >
          <a-descriptions-item label="执照有效期限">
            {{infoList.licenseTimeStart}} 至 
            {{infoList.licenseTimeEnd == null ? '长期' : infoList.licenseTimeEnd}}</a-descriptions-item
          >
        </a-descriptions>
        <a-descriptions title="法人身份证照" :column="1">
          <a-descriptions-item label="头像面" @click="download(this.img)"
            >
            <img :src="item.url" alt="" v-for="(item, index) in infoList.idCardFrontImgList" :key="index">
            </a-descriptions-item>
          <a-descriptions-item label="国徽面"
            ><img :src="item.url" alt="" v-for="(item, index) in infoList.idCardBackImgList" :key="index">
            </a-descriptions-item>
          <a-descriptions-item label="营业执照"
            ><img :src="item.url" alt="" v-for="(item, index) in infoList.businessLicenseImgList" :key="index">
            </a-descriptions-item>
          <a-descriptions-item label="其他附件"
            ><img :src="item.url" alt="" v-for="(item, index) in infoList.othersImgList" :key="index">
            </a-descriptions-item>
        </a-descriptions>
        <a-descriptions title="联系人信息" :column="3">
          <a-descriptions-item label="联系人"> {{infoList.contactsName}} </a-descriptions-item>
          <a-descriptions-item label="联系人号码">
            {{infoList.contactsTel}}
          </a-descriptions-item>
          <a-descriptions-item label="邮箱">{{infoList.contactsEmail}} </a-descriptions-item>
          <a-descriptions-item label="联系人地址">
            {{infoList.contactsAddressDetails}}
          </a-descriptions-item>
        </a-descriptions>
      </div>
    </div>
    <div class="footer">
      <a-space style="margin-left: 70%">
        <a-button type="primary" @click="auditShow=true">审核</a-button>
        <a-button @click="cancel">取消</a-button>
      </a-space>
    </div>
    <a-modal
      title="审核"
      :visible="auditShow"
      @ok="auditSubmit"
      @cancel="auditCancel"
    >
      <div class="content">
        <a-form :form="form">
          <a-form-item
            label="审核类型"
          >
            <a-select v-model="appForm.status" style="width: 120px">
                <a-select-option :value="1">
                    通过
                </a-select-option>
                <a-select-option :value="2">
                    驳回
                </a-select-option>
            </a-select>
          </a-form-item>
          <a-form-item
            label="审核留言"
          >
            <a-textarea v-model="appForm.reviewRemakes" style="" :auto-size="{ minRows: 5, maxRows: 8 }"></a-textarea>
          </a-form-item>
        </a-form>
      </div>
    </a-modal>
  </div>
</template>

<script>
import {getRequestDetail,isPass} from "@/api/manage/index.js"
export default {
	data() {
		return {
			form:{
				id: undefined
			},
      appForm: {
        id: undefined,
        status: 1,
        reviewRemakes: ''
      },
      infoList: [],
			auditShow: false,
			detailData: {},
    };
	},
	mounted() {
		this.form.id = this.$route.query.id;
    this.appForm.id = this.$route.query.id;
    this.getData()
	},
	methods: {
    getData() {
      getRequestDetail(this.form).then(res => {
        let data = res.data;
        this.infoList = data;
      })
    },
		download() {},
		cancel() {
			this.$router.go(-1);
		},
		auditSubmit(){
      isPass(this.appForm).then( () => {

      })
			this.auditShow = false
		},
		auditCancel(){
			this.auditShow = false
		}
	},
};
</script>

<style lang="less" scoped>
.content {
  padding-top: 0px;
  padding-bottom: 120px;
}
.content img {
  width: 142px;
  height: 107px;
  margin: 10px;
  cursor: pointer;
}
</style>