f
This commit is contained in:
@@ -220,6 +220,9 @@ export const certificationApi = {
|
|||||||
// 管理员代用户完成认证(暂不关联合同)
|
// 管理员代用户完成认证(暂不关联合同)
|
||||||
adminCompleteWithoutContract: (data) => request.post('/certifications/admin/complete-without-contract', data),
|
adminCompleteWithoutContract: (data) => request.post('/certifications/admin/complete-without-contract', data),
|
||||||
|
|
||||||
|
// 管理员触发重新认证(回退到提交企业信息,保留钱包/API Key/历史记录)
|
||||||
|
adminResetForResignContract: (data) => request.post('/certifications/admin/reset-for-resign-contract', data),
|
||||||
|
|
||||||
// 管理端企业审核:列表(按状态机 certification_status 筛选)、详情、通过、拒绝、按用户变更状态
|
// 管理端企业审核:列表(按状态机 certification_status 筛选)、详情、通过、拒绝、按用户变更状态
|
||||||
adminListSubmitRecords: (params) => request.get('/certifications/admin/submit-records', { params }),
|
adminListSubmitRecords: (params) => request.get('/certifications/admin/submit-records', { params }),
|
||||||
adminGetSubmitRecord: (id) => request.get(`/certifications/admin/submit-records/${id}`),
|
adminGetSubmitRecord: (id) => request.get(`/certifications/admin/submit-records/${id}`),
|
||||||
|
|||||||
@@ -543,6 +543,15 @@
|
|||||||
<div v-else class="text-center py-6 text-gray-500">
|
<div v-else class="text-center py-6 text-gray-500">
|
||||||
暂无合同信息
|
暂无合同信息
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6 flex flex-wrap gap-2">
|
||||||
|
<el-button type="warning" size="small" @click="openResignContractDialog">
|
||||||
|
重新认证
|
||||||
|
</el-button>
|
||||||
|
<span class="text-xs text-gray-400 self-center">
|
||||||
|
回退到填写企业信息,钱包 / API Key / 历史记录不受影响
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 未认证提示 -->
|
<!-- 未认证提示 -->
|
||||||
@@ -699,6 +708,59 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 管理员重新认证弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
v-model="resignContractDialogVisible"
|
||||||
|
title="重新认证"
|
||||||
|
:width="isMobile ? '90%' : '520px'"
|
||||||
|
class="enterprise-dialog"
|
||||||
|
>
|
||||||
|
<div v-if="selectedUser" class="space-y-4">
|
||||||
|
<el-alert
|
||||||
|
type="warning"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
title="回退到提交企业信息"
|
||||||
|
description="用户可在「企业入驻」重新填写企业信息并走完整认证流程。钱包余额、API Key、历史合同均保留,用户仍保持已认证状态。"
|
||||||
|
/>
|
||||||
|
<div class="user-info">
|
||||||
|
<div class="info-item">
|
||||||
|
<span class="info-label">用户手机:</span>
|
||||||
|
<span class="info-value">{{ formatPhone(selectedUser.phone) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-item">
|
||||||
|
<span class="info-label">企业名称:</span>
|
||||||
|
<span class="info-value">{{ selectedUser.enterprise_info?.company_name || '-' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-form ref="resignContractFormRef" :model="resignContractForm" :rules="resignContractRules" label-width="100px">
|
||||||
|
<el-form-item label="操作原因" prop="reason">
|
||||||
|
<el-input
|
||||||
|
v-model="resignContractForm.reason"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="请填写触发重新认证的原因,便于审计"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div :class="['dialog-footer', isMobile ? 'flex-col' : '']">
|
||||||
|
<el-button :class="isMobile ? 'w-full' : ''" @click="resignContractDialogVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
:class="isMobile ? 'w-full' : ''"
|
||||||
|
:loading="resignContractLoading"
|
||||||
|
@click="handleSubmitResignContract"
|
||||||
|
>
|
||||||
|
确认重新认证
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
</ListPageLayout>
|
</ListPageLayout>
|
||||||
</template>
|
</template>
|
||||||
@@ -745,6 +807,20 @@ const adminCertForm = reactive({
|
|||||||
reason: ''
|
reason: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 管理员重新签合同
|
||||||
|
const resignContractDialogVisible = ref(false)
|
||||||
|
const resignContractLoading = ref(false)
|
||||||
|
const resignContractFormRef = ref(null)
|
||||||
|
const resignContractForm = reactive({
|
||||||
|
reason: ''
|
||||||
|
})
|
||||||
|
const resignContractRules = {
|
||||||
|
reason: [
|
||||||
|
{ required: true, message: '请填写操作原因', trigger: 'blur' },
|
||||||
|
{ min: 2, max: 500, message: '原因长度需在 2-500 字之间', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
const adminCertRules = {
|
const adminCertRules = {
|
||||||
company_name: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
|
company_name: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
|
||||||
unified_social_code: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
|
unified_social_code: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
|
||||||
@@ -999,6 +1075,39 @@ const handleSubmitAdminCert = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开重新认证弹窗
|
||||||
|
const openResignContractDialog = () => {
|
||||||
|
if (!selectedUser.value?.is_certified) {
|
||||||
|
ElMessage.warning('仅已认证用户可重新认证')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resignContractForm.reason = ''
|
||||||
|
resignContractDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交重新认证
|
||||||
|
const handleSubmitResignContract = async () => {
|
||||||
|
if (!resignContractFormRef.value || !selectedUser.value) return
|
||||||
|
try {
|
||||||
|
await resignContractFormRef.value.validate()
|
||||||
|
resignContractLoading.value = true
|
||||||
|
await certificationApi.adminResetForResignContract({
|
||||||
|
user_id: selectedUser.value.id,
|
||||||
|
reason: resignContractForm.reason
|
||||||
|
})
|
||||||
|
ElMessage.success('已重置为重新认证,请通知用户前往企业入驻重新填写企业信息')
|
||||||
|
resignContractDialogVisible.value = false
|
||||||
|
userDialogVisible.value = false
|
||||||
|
await loadUsers()
|
||||||
|
await loadStats()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('重新认证失败:', error)
|
||||||
|
ElMessage.error(error?.response?.data?.message || '重新认证失败')
|
||||||
|
} finally {
|
||||||
|
resignContractLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 查看合同
|
// 查看合同
|
||||||
const handleViewContract = (contract) => {
|
const handleViewContract = (contract) => {
|
||||||
if (contract.contract_file_url) {
|
if (contract.contract_file_url) {
|
||||||
|
|||||||
Reference in New Issue
Block a user