<template>
  <basic-container>
    <avue-form :option="option" v-model="reviewDetail">
      <template slot-scope="scope" slot="face">
        <el-image :src="reviewDetail.face" style="width:180px; height:180px" alt="" :preview-src-list="reviewDetail.face"></el-image>
      </template>
      <template slot-scope="scope" slot="sex">
        <el-input placeholder="未选择性别" :disabled="true" v-model="reviewDetail.$sex"></el-input>
      </template>
    </avue-form>
    <div>
      <el-row>
        <el-col span="24" align="center">
          <el-button type="warning" icon="el-icon-edit" size="small" @click="reviewExamine(0)">待审核</el-button>
          <el-button type="primary" icon="el-icon-check" size="small" @click="reviewExamine(1)">通过</el-button>
          <el-button type="info" icon="el-icon-delete" size="small" @click="reviewExamine(2)">不通过</el-button>
        </el-col>
      </el-row>
    </div>
  </basic-container>
</template>

<script>
  import {update} from "@/api/enterprise/staff";
  export default {
    props: {
      reviewDetail: {},
      url: '',
      reviewVisible: ''
    },
    data() {
      return {
        option:{
          menuBtn: false,
          group:[
            {
              icon:'el-icon-user',
              label: '个人信息认证',
              prop: 'group1',
              column: [{
                label: '姓名',
                prop: 'realName',
                placeholder: "未提交姓名",
                readonly: true
              },{
                label: '性别',
                prop: 'sex',
                placeholder: "未选择性别",
                formslot: true,
                readonly: true,
              },{
                label: '身份证号',
                prop: 'idcard',
                placeholder: "未输入有效的身份证号",
                readonly: true
              },{
                label: '手机号',
                prop: 'phone',
                placeholder: "未输入有效的手机号",
                readonly: true
              },{
                label: '脸部信息',
                prop: 'face',
                type: 'upload',
                listType: 'picture-img',
                formslot: true,
                disabled: true
              }]
            },{
              icon:'el-icon-office-building',
              label: '企业信息认证',
              prop: 'group2',
              column: [{
                label: '公司园区',
                prop: 'agencyName',
                placeholder: "未选择公司园区",
                readonly: true
              },{
                label: '园区区域',
                prop: 'residentialName',
                placeholder: "未选择园区区域",
                readonly: true
              },{
                label: '所属企业',
                prop: 'enterpriseName',
                placeholder: "未输入企业名称",
                readonly: true
              }]
            },{
              icon:'el-icon-chat-line-square',
              label: '其他信息',
              prop: 'group2',
              column: [{
                label: '备注',
                prop: 'remarks',
                type: "textarea",
                maxRows: 4,
                minRows: 2
              }]
            }
          ]
        }
      }
    },
    methods: {
      reviewExamine(examine, loading ){
        this.reviewDetail.examine = examine;
        update(this.reviewDetail).then(() => {
          this.reviewVisible = false;
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$emit('visibleemit', this.reviewVisible);
        }, error => {
          this.$message({
            type: "error",
            message: "操作失败!"
          });
          loading();
          console.log(error);
        });
      }
    }
  }

</script>

<style scoped>

</style>







