cert_ji_old.vue 5.89 KB
<template>
  <el-row>
    <el-col :lg="18" :sm="24">
      <div class="wPanel">
        <img class="forWei poimg" src="@/assets/h5/cx@2x.png">
        <h2>旧版级位证书查询</h2>
        <el-form ref="queryRef" :model="queryParams" :rules="rules" label-width="120">
          <el-form-item label="证书编号" prop="queryCode">
            <el-input
              v-model.trim="queryParams.queryCode"
              placeholder="请输入证书编号"
              size="large"
              clearable
              prefix-icon="Postcard"
              @keyup.enter="handleQuery"
            />
          </el-form-item>
          <el-form-item label="图形验证码" prop="code">
            <captcha ref="codeRef" v-model="queryParams.code" v-model:uuid="queryParams.uuid" :auto-load="false" @keyup.enter="handleQuery" />
          </el-form-item>
          <el-form-item>
            <el-button class="search-btn" round type="default" plain @click="handleQuery">
              <el-icon class="el-icon--left"><Search /></el-icon>查询
            </el-button>
          </el-form-item>
        </el-form>
      </div>
      <el-divider class="forPc" />
      <div class="wPanel mt20">
        <img class="forWei poimg" src="@/assets/h5/jg@2x.png">
        <h2>级位证书查询结果</h2>
        <el-form label-width="120">
          <el-form-item label="会员名称">
            <el-input v-model="resultForm.name" readonly />
          </el-form-item>
          <el-form-item label="证书编号">
            <el-input v-model="resultForm.certCode" readonly />
          </el-form-item>
          <el-form-item label="级 位">
            <el-input v-model="resultForm.level" readonly />
          </el-form-item>
          <el-form-item label="考 官">
            <el-input v-model="resultForm.examiner" readonly />
          </el-form-item>
          <el-form-item label="发证日期">
            <el-input v-model="resultForm.certTime" readonly />
          </el-form-item>
        </el-form>
      </div>
    </el-col>
  </el-row>

  <div v-if="showCert" class="cert">
    <div class="bg_certificate bg_c1">
      <button type="button" class="close" @click="showCert=false">
        <span aria-hidden="true">×</span>
      </button>
      <input readonly type="text" class="input_certificate c3_new_00_cn c_center" :value="resultForm.level">
      <input readonly type="text" class="input_certificate c3_new_00_en c_center" :value="resultForm.level_en">
      <input readonly type="text" class="input_certificate c3_new_01" :value="resultForm.certCode">
      <input readonly type="text" class="input_certificate c3_new_02" :value="resultForm.name">
      <input readonly type="text" class="input_certificate c3_new_03" :value="resultForm.examiner">
      <input readonly type="text" class="input_certificate c3_new_04" :value="resultForm.certTime"></div>
  </div>
</template>

<script setup>
import { getCurrentInstance, reactive } from '@vue/runtime-core'
import { toRefs } from 'vue'
import Captcha from '@/views/login/components/captcha'
import * as authentic from '@/apiPc/authentic'
import { customMessageBox } from '@/utils/ruoyi'

const { proxy } = getCurrentInstance()

const data = reactive({
  queryParams: {
    queryCode: undefined,
    code: undefined,
    uuid: undefined
  },
  rules: {
    queryCode: [{ required: true, trigger: 'blur', message: '请输入证件号码' }],
    code: [{ required: true, trigger: 'blur', message: '请输入图形验证码' }]
  },
  resultForm: {},
  showCert: false
})
const { queryParams, rules, resultForm, showCert } = toRefs(data)

function handleQuery() {
  proxy.$refs['queryRef'].validate((valid) => {
    if (valid) {
      resultForm.value = {}
      authentic.oldJiQuery(queryParams.value).then(res => {
        if (res.data) {
          resultForm.value = res.data
          showCert.value = true
        } else {
          customMessageBox('没有查询到相应的数据')
        }
      }).finally(getCode)
    }
  })
}

function getCode() {
  proxy.$refs['codeRef'].getCode()
}
function init() {
  getCode()
}
defineExpose({
  init
})
</script>

<style scoped lang="scss">
  h2{color:var(--el-color-primary);font-size: 18px;text-align: center;margin:0 0 30px;}
  :deep(.el-input__wrapper){background: #FBFCFD;}

  .forWei {
    display: none;
  }
  @media (max-width: 500px) {
    h2{ color: #000; }
    .forWei {display: block;}
    .forPc{display: none}
    .wPanel{position: relative;}
    .poimg{width: 110px;position: absolute;right: 10px;top:0;}
    .search-btn{background: var(--el-color-primary);color: #fff;border: none;
    display: block;width: calc(100vw - 260px);}
  }
  .bg_c1 {
    background: url("@/assets/v1/cert/ji.jpg") no-repeat;
  }
  .bg_certificate {
    position: relative;
    padding: 10px;
    width: 800px;
    height: 565px;
    .close{    -webkit-appearance: none;
      padding: 0;    float: right;
      cursor: pointer;
      border: 0;
      margin-top: 10px;
      margin-right: 10px;
      width: 24px;
      height: 24px;
      border-radius: 8px;
      background-color: #900;
      color: #fff;
      font-size: 16px;
      opacity: 1;
    }
    .input_certificate {
      position: absolute;
      font-size: 16px;
      font-weight: bold;
      font-family: "宋体";
      border: none;
      background: none;
    }
    .c_center{ position:relative; display:block; margin:0 auto; text-align:center;}
    .c3_new_00_cn,.c3_old_00_cn,.c4_china_00_cn{ margin-top:170px; font-size:24px;}
    .c3_new_00_en,.c3_old_00_en,.c4_china_00_en{ margin-top:-10px; font-size:14px; color:#666;}
    .c3_new_01,.c3_old_01{ top:250px; left:250px;}
    .c3_new_02,.c3_old_02{ top:320px; left:250px;}
    .c3_new_03,.c3_old_03{ top:250px; left:520px;}
    .c3_new_04,.c3_old_04{ top:320px; left:520px;}
  }
  .cert{position: fixed;height: 100vh;width: 100vw;overflow: auto;z-index: 2;
    display: flex;align-items: center;justify-content: center;
    top: 0;left: 0;background: rgba(0,0,0,0.6);
  }
</style>