马宇豪
2024-11-13 12a7587eb12e3d33809ef9c169dd76b20ac707c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<template>
  <div class="form-container">
    <el-dialog
        v-model="dialogVisible"
        title="专家申请进度查询"
        width="550px"
        :before-close="handleClose"
        center
    >
      <el-form :model="state.form" size="default" ref="formRef" :rules="state.formRules" label-width="110px" >
        <el-form-item label="身份证号:" prop="idCard">
          <el-input v-model.trim="state.form.idCard" placeholder="请输入身份证号"></el-input>
        </el-form-item>
        <el-form-item label="手机号:" prop="phone">
          <el-input v-model.trim="state.form.phone" placeholder="请输入申报时预留的手机号"></el-input>
        </el-form-item>
        <el-form-item label="业务处室:" prop="roomId">
          <el-select v-model="state.form.roomId"  style="width: 100%" class="m-2" placeholder="请选择申请的业务处室">
            <el-option
                v-for="item in state.agencyList"
                :key="item.id"
                :label="item.name"
                :value="item.name"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
            <el-button type="primary"  @click="onSubmit" size="default" v-preReClick>进度查询</el-button>
        </span>
      </template>
    </el-dialog>
    <div class="pro-map">
      <button class="pro-btn-active">申请提交</button>
      <button class="pro-btn">
        <span>待评定</span>
      </button>
      <button class="pro-btn">
        专家入库
      </button>
      <button class="pro-btn">
        专家证书下载
      </button>
    </div>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue'
import {ElMessage, ElMessageBox} from "element-plus"
import {verifyPhone, verifyIdCard} from "../../../../utils/validate"
import { getToken } from "@/utils/auth"
 
 
let validatePhone = (rule, value, callback)=>{
  if(value === ''){
    callback(new Error('请输入手机号'))
  }else{
    if(!verifyPhone(value)){
      callback(new Error('手机号格式有误'))
    }else{
      callback()
    }
  }
}
let verifyId = (rule, value, callback)=>{
  if(value === ''){
    callback(new Error('请输入身份证号'))
  }else{
    if(!verifyIdCard(value)){
      callback(new Error('身份证号格式有误'))
    }else{
      callback()
    }
  }
}
 
const dialogVisible = ref(false)
const formRef = ref()
const handleClose = () => {
  reset();
  formRef.value.clearValidate();
  dialogVisible.value = false;
}
 
 
const state = reactive({
  form:{
    idCard: null,
    phone: '',
    roomId: null
  },
  formRules:{
    idCard:[{ required: true, validator: verifyId, trigger: 'blur' }],
    phone:[{ required: true, validator: validatePhone, trigger: 'blur' }],
    roomId: [{ required: true, message: '请选择申请的业务处室', trigger: 'blur' }]
  }
})
 
onMounted(()=>{
 
})
 
const onSubmit = async (formEl)=> {
  if (!formEl) return
  await formEl.validate(async (valid, fields) => {
    if (valid) {
 
    } else {
      ElMessage.warning('请完善必填信息')
    }
  })
}
 
</script>
 
<style scoped lang="scss">
.form-container{
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
 
  .pro-map{
    width: 75%;
    margin-top: 40px;
    display: flex;
    justify-content: space-around;
 
    .pro-btn {
      width: calc(25% - 20px);
      color: #fff;
      cursor: pointer;
      border: 1px solid #000;
      border-radius: 40px 99px 99px 40px;
      padding: 2em 4em;
      background: #000;
      transition: 0.2s;
    }
 
    .pro-btn-active {
      width: calc(25% - 20px);
      color: #fff;
      cursor: pointer;
      border: 1px solid #000;
      border-radius: 40px 99px 99px 40px;
      padding: 2em 4em;
      transition: 0.2s;
      transform: translate(-0.25rem, -0.25rem);
      background: #03a9f4;
      box-shadow: 0.25rem 0.25rem #000;
    }
  }
}
</style>