<template>
  <div>
    <div class="p-wrap-full mb20 ng-scope">
      <div class="title-box mt5 clear">
        <h2 class="title">查询证书</h2>
      </div>
      <div class="learning-time-panel-2 mt30">
        <div class="panel-bd tc">
          <input type="text" v-model="periodObj.cardId"
              class="ui-ipt ipt-1 ng-pristine ng-valid"
              style="line-height: 1;padding: 10px"
              placeholder="请输入证件号">

          <input type="text" style="line-height: 1;padding: 10px"
            v-model="periodObj.nickname"
            class="ui-ipt ng-pristine ng-valid"
            placeholder="请输入姓名">

          <input class="ui-btn btn-r"
            @click="goVerify()"
            type="button"
            value="立即查询">
        </div>
      </div>
    </div>
    <el-table v-if="recodeList.length>0" :data="recodeList" border fit highlight-current-row class="p-wrap-full mb20 ng-scope">
      <el-table-column label="姓名" prop="userName" width="90" align="center"> </el-table-column>
      <el-table-column label="身份证" prop="cardId" width="165" align="center"> </el-table-column>
      <el-table-column label="证书编号" prop="certificateNum" min-width="120" align="center" > </el-table-column>
      <el-table-column label="岗位名称" prop="positionName" width="120" align="center" > </el-table-column>
      <el-table-column label="证书状态" prop="certificateStatus" width="80" align="center" > </el-table-column>


      <el-table-column label="证书类型" prop="certificateType" width="140" align="center" > </el-table-column>
      <el-table-column label="岗位编码" prop="careerCode" width="90" align="center"> </el-table-column>

      <el-table-column label="发证机关" prop="certificateOrgan"  align="center"> </el-table-column>
      <el-table-column label="发证时间" prop="startTime" width="100" align="center" > </el-table-column>
      <el-table-column label="复核时间" prop="reviewTime" width="100" align="center"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
  import {httpServer} from "@/components/httpServer/httpServer.js";
  export default {
    data(){
      return {
        periodObj:{
          nickname:'',
          cardId:'',
        },
        recodeList:[] ,
      }
    },
    methods: {
      goVerify(){
        let {nickname,cardId} = this.periodObj;
        if( !nickname || cardId.length <15 || cardId.length> 18){
          this.$message({message:'请输入大陆身份证（15-18位）'})
          return
        }
        httpServer("User.ReLoadRzCode", {nickname,cardId}).then( res=>{
          if( res.code == 200){
            this.recodeList = res.data;
          }
        })
      }
    }
  }
</script>

<style>
  @import url("learnTime.css");
</style>
