<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">
        <!--<span>{{reviewDetail.$sex}}</span>-->
        <el-input placeholder="未选择性别" :disabled="true" v-model="reviewDetail.$sex"></el-input>
      </template>
    </avue-form>
     <div>
       <el-row>
         <el-col span="24" align="right">
           <el-button type="warning" icon="el-icon-edit" size="small" @click="reviewauditStatus(0)">待审核</el-button>
           <el-button type="primary" icon="el-icon-check" size="small" @click="reviewauditStatus(1)">通过</el-button>
           <el-button type="info" icon="el-icon-delete" size="small" @click="reviewauditStatus(2)">不通过</el-button>
         </el-col>
       </el-row>
     </div>
  </basic-container>
</template>

<script>
  import {getList, getDetail, add, update, remove} from "@/api/enterprise/staff";
  export default {
    props: {
      reviewDetail: {},
      url: '',
      reviewVisible: ''
    },
    data() {
      return {
        option:{
          menuBtn: false,
          group:[
            {
              icon:'el-icon-user',
              label: '个人信息认证',
              // collapse:false,
              prop: 'group1',
              column: [{
                label: '姓名',
                prop: 'realName',
                placeholder: "未提交姓名",
                readonly: true
                // disabled: true
              },{
                label: '性别',
                prop: 'sex',
                placeholder: "未选择性别",
                formslot: true,
                readonly: true,
                // disabled: true
              },{
                label: '身份证号',
                prop: 'idcard',
                placeholder: "未输入有效的身份证号",
                readonly: true
                // disabled: true
              },{
                label: '手机号',
                prop: 'phone',
                placeholder: "未输入有效的手机号",
                readonly: true
                // disabled: true
              },{
                label: '脸部信息',
                prop: 'face',
                type: 'upload',
                listType: 'picture-img',
                // listType: 'picture-card',
                // alone: true,
                formslot: true,
                // placeholder: "未采集脸部信息",
                // readonly: true
                disabled: true
              }]
            },{
              icon:'el-icon-office-building',
              label: '企业信息认证',
              // arrow:false,
              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: '其他信息',
              // arrow:false,
              prop: 'group2',
              column: [{
                label: '备注',
                prop: 'remarks',
                type: "textarea",
                maxRows: 4,
                minRows: 2
              }]
            }
          ]
        }
      }
    },
    methods: {
      reviewauditStatus(auditStatus, loading ){
        this.reviewDetail.auditStatus = auditStatus;

        update(this.reviewDetail).then(() => {
          this.reviewVisible = false;
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$emit('visibleemit', this.reviewVisible);
          // done();
        }, error => {
          this.$message({
            type: "error",
            message: "操作失败!"
          })
          loading();
          console.log(error);
        });


        // this.$emit('reviewemit', this.reviewDetail);
      }

    }
  }

</script>

<style scoped>

</style>







