<template>
  <div id="check-1">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-form :model="form" :rules="rules" ref="form" label-width="170px">
            <el-col :span="12">
              <el-form-item label="姓名">
                <el-input v-model="form.name" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证号">
                <el-input v-model="form.card" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出生日期">
                <el-input v-model="form.birth" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系电话">
                <el-input v-model="form.phone" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发证日期">
                <el-input v-model="form.cert_date" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职业等级">
                <el-input v-model="form.exam_grade" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="保安员编号">
                <el-input v-model="form.baoan_num" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="证件状态">
                <el-input v-model="form.cert_status" readonly></el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
              <el-form-item label="打印人">
                <el-input v-model="form.print_personal" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="打印公安机关名称">
                <el-input v-model="form.print_policename" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="打印时间">
                <el-input v-model="form.print_date" readonly></el-input>
              </el-form-item>
            </el-col> -->
            <el-col :span="24">
              <el-form-item label="补打申请原因">
                <el-input v-model="form.make_apply" readonly type="textarea" rows="2"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打申请公安机关代码">
                <el-input v-model="form.make_applynum" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打申请公安机关名称">
                <el-input v-model="form.make_applypolice" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打申请人">
                <el-input v-model="form.make_applypersonal" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打申请时间">
                <el-input v-model="form.make_applydate" readonly></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打审核公安机关代码" prop="make_examinenum">
                <el-input v-model="form.make_examinenum" placeholder="请输入补打审核公安机关代码"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打审核公安机关名称" prop="make_examinename">
                <el-input v-model="form.make_examinename" placeholder="请输入补打审核公安机关名称"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打审核人" prop="make_examinepersonal">
                <el-input v-model="form.make_examinepersonal" placeholder="请输入补打审核人"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="补打审核时间" prop="make_examinedate">
                <el-date-picker
                  v-model="form.make_examinedate"
                  placeholder="请选择"
                  value-format="yyyy-MM-dd"
                  format="yyyy-MM-dd"
                  type="date"
                  style="width: 100%"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="24" class="third_1">
              <el-col :span="4" class="third_1text"><span>审查情况</span></el-col>
              <el-col :span="20">
                <el-col :span="24">
                  <el-form-item label="是否受到过收容教育，强制隔离戒毒，劳动教养者3次以上行政拘留" prop="check_xzjl" :label-width="longLabel">
                    <el-radio-group v-model="form.check_xzjl">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="是否因故意犯罪被刑事处罚" prop="check_xscf" :label-width="longLabel">
                    <el-radio-group v-model="form.check_xscf">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="是否吊销保安员证未满3年" prop="check_certthr" :label-width="longLabel">
                    <el-radio-group v-model="form.check_certthr">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="是否两次被吊销保安员证" prop="check_certtwo" :label-width="longLabel">
                    <el-radio-group v-model="form.check_certtwo">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="疑似精神病人，风险评估不能担任保安员" prop="check_fxpg" :label-width="longLabel">
                    <el-radio-group v-model="form.check_fxpg">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="是否有其他不合适担任保安的综合评定" prop="check_zhpd" :label-width="longLabel">
                    <el-radio-group v-model="form.check_zhpd">
                      <el-radio label="是"></el-radio>
                      <el-radio label="否"></el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-form-item label="补打审核意见" prop="make_examineresaon">
                <el-input v-model="form.make_examineresaon" type="textarea" rows="2" placeholder="请输入补打审核意见"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24" class="btn">
              <el-button type="primary" size="small" @click="passBtn('form')">审核通过</el-button>
              <el-button type="danger" size="small" @click="nopassBtn('form')">审核拒绝</el-button>
            </el-col>
          </el-form>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'check-1',
  props: {
    form: { type: Object },
  },
  components: {},
  data: function () {
    return {
      longLabel: '500px',
      rules: {
        make_examinenum: [{ required: true, message: '请输入补打审核公安机关代码', trigger: 'blur' }],
        make_examinename: [{ required: true, message: '请输入补打审核公安机关名称', trigger: 'blur' }],
        make_examinepersonal: [{ required: true, message: '请输入补打审核人', trigger: 'blur' }],
        make_examinedate: [{ required: true, message: '请选择', trigger: 'change' }],
        check_xzjl: [{ required: true, message: '请选择', trigger: 'change' }],
        check_xscf: [{ required: true, message: '请选择', trigger: 'change' }],
        check_certthr: [{ required: true, message: '请选择', trigger: 'change' }],
        check_certtwo: [{ required: true, message: '请选择', trigger: 'change' }],
        check_fxpg: [{ required: true, message: '请选择', trigger: 'change' }],
        check_zhpd: [{ required: true, message: '请选择', trigger: 'change' }],
        make_examineresaon: [{ required: true, message: '请输入补打审核意见', trigger: 'blur' }],
      },
    };
  },
  created() {},
  methods: {
    passBtn(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$emit('onSubmit', { data: this.form, status: '1' });
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    nopassBtn(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$emit('onSubmit', { data: this.form, status: '-1' });
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.third_1 {
  border: 1px solid #cccccc;
  padding: 10px;
  margin: 0 0 10px 0;
  .third_1text {
    padding: 50px 0;
    text-align: center;
    span {
      border: 1px solid #ff0000;
      display: inline-block;
      width: 100px;
      height: 120px;
      line-height: 120px;
      color: #ff0000;
      font-weight: bold;
    }
  }
  /deep/.el-form-item__label {
    text-align: left;
    color: #ff0000;
  }
  /deep/.el-form-item {
    margin: 0;
    border: 1px solid #ccc;
    padding: 0 15px;
  }
}
.main {
  .one {
    .btn {
      text-align: center;
    }
  }
}
</style>
