add
This commit is contained in:
@@ -68,6 +68,14 @@
|
||||
@submit="handleEnterpriseSubmit"
|
||||
/>
|
||||
|
||||
<ManualReviewPending
|
||||
v-if="currentStep === 'manual_review'"
|
||||
:certification-data="certificationData"
|
||||
:submit-time="manualReviewSubmitTime"
|
||||
:company-name="enterpriseForm.companyName"
|
||||
@refresh="getCertificationDetails"
|
||||
/>
|
||||
|
||||
<EnterpriseVerify
|
||||
v-if="currentStep === 'enterprise_verify'"
|
||||
:enterprise-data="enterpriseForm"
|
||||
@@ -120,6 +128,7 @@ import { useUserStore } from '@/stores/user'
|
||||
import {
|
||||
BuildingOfficeIcon,
|
||||
CheckCircleIcon,
|
||||
ClockIcon,
|
||||
CodeBracketIcon,
|
||||
DocumentTextIcon,
|
||||
UserIcon,
|
||||
@@ -133,6 +142,7 @@ import ContractRejected from './components/ContractRejected.vue'
|
||||
import ContractSign from './components/ContractSign.vue'
|
||||
import EnterpriseInfo from './components/EnterpriseInfo.vue'
|
||||
import EnterpriseVerify from './components/EnterpriseVerify.vue'
|
||||
import ManualReviewPending from './components/ManualReviewPending.vue'
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
// 认证步骤配置
|
||||
@@ -143,6 +153,12 @@ const certificationSteps = [
|
||||
description: '填写企业基本信息和法人信息',
|
||||
icon: BuildingOfficeIcon,
|
||||
},
|
||||
{
|
||||
key: 'manual_review',
|
||||
title: '人工审核',
|
||||
description: '等待管理员审核企业信息',
|
||||
icon: ClockIcon,
|
||||
},
|
||||
{
|
||||
key: 'enterprise_verify',
|
||||
title: '企业认证',
|
||||
@@ -176,6 +192,18 @@ const currentStepIndex = computed(() => {
|
||||
// 步骤特定元数据
|
||||
const stepMeta = ref({}) // 用于存储当前步骤的metadata
|
||||
|
||||
// 人工审核步骤的提交时间展示
|
||||
const manualReviewSubmitTime = computed(() => {
|
||||
const at = certificationData.value?.metadata?.enterprise_info?.submit_at ?? certificationData.value?.info_submitted_at
|
||||
if (!at) return ''
|
||||
try {
|
||||
const d = new Date(at)
|
||||
return Number.isNaN(d.getTime()) ? '' : d.toLocaleString('zh-CN')
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const enterpriseForm = ref({
|
||||
companyName: '',
|
||||
@@ -188,35 +216,32 @@ const enterpriseForm = ref({
|
||||
enterpriseEmail: '',
|
||||
})
|
||||
|
||||
// 开发模式控制
|
||||
//
|
||||
const isDevelopment = ref(false)
|
||||
const devCurrentStep = ref('enterprise_info')
|
||||
|
||||
// 合同签署加载状态
|
||||
const contractSignLoading = ref(false)
|
||||
|
||||
// 事件处理
|
||||
const handleEnterpriseSubmit = async (formData) => {
|
||||
// 事件处理:优先用提交接口返回的认证数据更新步骤,确保进入「人工审核」页,避免依赖二次请求
|
||||
const handleEnterpriseSubmit = async (payload) => {
|
||||
try {
|
||||
loading.value = true
|
||||
// 字段映射
|
||||
const payload = {
|
||||
company_name: formData.companyName,
|
||||
unified_social_code: formData.unifiedSocialCode,
|
||||
legal_person_name: formData.legalPersonName,
|
||||
legal_person_id: formData.legalPersonID,
|
||||
legal_person_phone: formData.legalPersonPhone,
|
||||
enterprise_address: formData.enterpriseAddress,
|
||||
enterprise_email: formData.enterpriseEmail,
|
||||
verification_code: formData.legalPersonCode,
|
||||
const nextAction = payload?.response?.data?.metadata?.next_action
|
||||
if (nextAction) {
|
||||
ElMessage.success(nextAction)
|
||||
} else {
|
||||
ElMessage.success('企业信息提交成功,请等待管理员审核')
|
||||
}
|
||||
if (payload?.response?.data?.status) {
|
||||
certificationData.value = payload.response.data
|
||||
stepMeta.value = payload.response.data?.metadata || {}
|
||||
await setCurrentStepByStatus()
|
||||
} else {
|
||||
await getCertificationDetails()
|
||||
}
|
||||
await certificationApi.submitEnterpriseInfo(payload)
|
||||
ElMessage.success('企业信息提交成功')
|
||||
// 提交成功后刷新认证详情
|
||||
await getCertificationDetails()
|
||||
} catch (error) {
|
||||
ElMessage.error(error?.message || '提交失败,请检查表单信息')
|
||||
// 提交失败时不刷新认证详情,保持用户填写的信息
|
||||
ElMessage.error(error?.message || '获取认证状态失败,请刷新页面')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -355,6 +380,9 @@ const setCurrentStepByStatus = async () => {
|
||||
case 'pending':
|
||||
currentStep.value = 'enterprise_info'
|
||||
break
|
||||
case 'info_pending_review':
|
||||
currentStep.value = 'manual_review'
|
||||
break
|
||||
case 'info_submitted':
|
||||
currentStep.value = 'enterprise_verify'
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user