This commit is contained in:
2026-08-08 11:05:45 +08:00
parent 6f709267b7
commit 4835904507
5 changed files with 133 additions and 13 deletions
+14 -3
View File
@@ -76,6 +76,7 @@ const decisionOpen = ref(false)
const reviewSubmitting = ref(false)
const approvalResultOpen = ref(false)
const approvalResult = ref<EnterpriseApprovalResponse | null>(null)
const credentialSource = ref<'creation' | 'approval'>('approval')
const decision = reactive({ type: 'approve' as 'approve' | 'reject', comment: '' })
const decisionFormRef = ref<FormInstance>()
const passwordDialogOpen = ref(false)
@@ -558,8 +559,17 @@ async function saveCustomer() {
saved = await updatePlatformTenant(editingId.value, payload)
} else {
const { unifiedSocialCreditCode: _qualificationCreditCode, ...payload } = form.value
saved = await createPlatformTenant(payload)
const created = await createPlatformTenant(payload)
saved = created.tenant
editingId.value = String(saved.id)
credentialSource.value = 'creation'
approvalResult.value = {
tenantId: saved.id,
administratorCreated: true,
administratorUsername: created.administratorUsername,
temporaryPassword: created.temporaryPassword,
}
approvalResultOpen.value = true
}
editorStatus.value = saved.status
savedFormSnapshot.value = JSON.stringify(form.value)
@@ -780,6 +790,7 @@ async function submitDecision() {
: '企业资料已审核通过,注册账号继续作为企业管理员'
ElMessage.success(successMessage)
if (approved?.administratorCreated) {
credentialSource.value = 'approval'
approvalResult.value = approved
approvalResultOpen.value = true
}
@@ -930,9 +941,9 @@ onMounted(() => { void loadCustomers() })
<template #footer><el-button @click="qualificationPreviewOpen = false">关闭预览</el-button></template>
</el-dialog>
<el-dialog v-model="approvalResultOpen" title="审核通过,管理员账号已创建" width="min(560px, calc(100vw - 28px))" class="approval-result-dialog" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
<el-dialog v-model="approvalResultOpen" :title="credentialSource === 'creation' ? '客户已创建,管理员账号已生成' : '审核通过,管理员账号已创建'" width="min(560px, calc(100vw - 28px))" class="approval-result-dialog" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
<div v-if="approvalResult" class="approval-result-content">
<div class="approval-result-warning" role="alert"><ShieldCheck :size="20" /><div><strong>请立即保存以下一次性凭证</strong><span>临时密码只在本次审核响应中返回,关闭后无法再次查看。</span></div></div>
<div class="approval-result-warning" role="alert"><ShieldCheck :size="20" /><div><strong>请立即保存以下一次性凭证</strong><span>临时密码只在本次{{ credentialSource === 'creation' ? '创建' : '审核' }}响应中返回,关闭后无法再次查看。</span></div></div>
<dl class="approval-credentials">
<div><dt>登录账号</dt><dd><code>{{ approvalResult.administratorUsername || '未返回' }}</code><CopyButton v-if="approvalResult.administratorUsername" :value="approvalResult.administratorUsername" label="登录账号" size="small" /></dd></div>
<div><dt>临时密码</dt><dd><code>{{ approvalResult.temporaryPassword || '未返回' }}</code><CopyButton v-if="approvalResult.temporaryPassword" :value="approvalResult.temporaryPassword" label="临时密码" size="small" /></dd></div>