feat: 支持评估版本隔离的报告、匹配及PDF导出功能
新增revisionId参数到路由、服务及导出接口,实现不同评估版本的隔离访问。删除已废弃的需求相关服务文件,移除取消采集的融资金额、期限和用途字段,更新相关页面提示文本。同时更新文档,说明评估版本、最新资料及产品展示规则的调整,支持前台正常业务名称显示,去除环境标签。
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<view class="actions">
|
||||
<view class="action-row" @click="prepare"><image class="action-icon" src="/packages/finance/static/action-prepare.svg" /><view class="action-copy"><text class="action-title">{{ productId.length > 0 && !canPrepare ? '核对产品条件' : '准备申请' }}</text><text class="action-note">{{ productId.length == 0 ? '选择本次匹配产品,查看材料准备说明' : '核对产品条件,了解所需材料' }}</text></view><text class="chevron">›</text></view>
|
||||
<view class="action-row" @click="openReport"><image class="action-icon" src="/packages/finance/static/action-report.svg" /><view class="action-copy"><text class="action-title">查看已保存报告</text><text class="action-note">报告已保存至融资档案,可随时查看</text></view><text class="chevron">›</text></view>
|
||||
<view class="action-row" @click="optimize"><image class="action-icon" src="/packages/finance/static/action-improve.svg" /><view class="action-copy"><text class="action-title">优化资料</text><text class="action-note">核对待补充与待核实项,再发起新评估</text></view><text class="chevron">›</text></view>
|
||||
<view class="action-row" @click="optimize"><image class="action-icon" src="/packages/finance/static/action-improve.svg" /><view class="action-copy"><text class="action-title">优化资料</text><text class="action-note">核对待补充与待核实项,修改后重新评估</text></view><text class="chevron">›</text></view>
|
||||
<view class="action-row last" @click="consult"><image class="action-icon" src="/packages/finance/static/action-chat.svg" /><view class="action-copy"><text class="action-title">咨询AI</text><text class="action-note">结合本次报告,为您解释准备方向</text></view><text class="chevron">›</text></view>
|
||||
</view>
|
||||
<view v-if="section == 'prepare'" id="prepare-section" class="panel">
|
||||
@@ -20,7 +20,6 @@
|
||||
<template v-else-if="matchError.length > 0"><text class="body">{{ matchError }}</text><button class="secondary" @click="load">重新核对产品</button></template>
|
||||
<template v-else-if="match != null">
|
||||
<text class="product-title">{{ match!.product.name }}</text><text class="note">{{ match!.product.bank }} · 评估时版本 v{{ match!.product.version }}</text>
|
||||
<text v-if="match!.product.demo" class="demo">演示产品,仅用于功能验证,不代表真实在售产品。</text>
|
||||
<text class="status">{{ match!.stateLabel }} · {{ match!.availabilityLabel }}</text>
|
||||
<template v-if="canPrepare">
|
||||
<text class="label">所需材料与办理说明</text><text class="body">{{ match!.product.materials }}</text>
|
||||
@@ -38,10 +37,10 @@
|
||||
<view v-for="item in missingItems" :key="item.label" class="field-row"><text class="field-label">{{ item.label }}</text><text class="field-state">{{ item.value }}</text></view>
|
||||
<text v-if="missingItems.length == 0" class="body">{{ report!.version == 1 ? '旧版报告未记录逐项完整度,请参考以下报告提示。' : '本次报告没有列出待补充或格式需核实字段,自填资料仍需核验。' }}</text>
|
||||
<text v-for="item in report!.dataGaps" :key="item" class="body">{{ item }}</text><text v-for="item in report!.suggestions" :key="item" class="body">{{ item }}</text>
|
||||
<text class="note">将进入同类型空白表单,不带入旧资料。正式提交后生成新记录,原报告保持不变。</text><button class="primary" @click="restart">重新进行{{ assessmentType == 'enterprise' ? '企业' : '个人' }}评估</button>
|
||||
<text class="note">将回填本评估最新提交的资料。修改后保存为新的提交版本,历史资料和报告仍可查看。</text><button class="primary" @click="restart">修改资料并重新评估</button>
|
||||
</view>
|
||||
<view class="notice"><text class="notice-title">重要提示</text><text class="notice-text">本页仅提供材料准备与办理引导,不向银行或其他机构提交申请。匹配结果基于自填资料,不代表授信或获批承诺;实际产品条件、材料及办理方式以机构核实为准。</text></view>
|
||||
<ReportExport :assessmentId="assessmentId" @authrequired="login" @sessionchanged="load" />
|
||||
<ReportExport :assessmentId="assessmentId" :revisionId="revisionId" @authrequired="login" @sessionchanged="load" />
|
||||
</template>
|
||||
<button class="home-button" @click="home">返回首页</button>
|
||||
</view>
|
||||
@@ -59,7 +58,7 @@
|
||||
import { AnalysisReport, AssessmentField, fetchAnalysisReport, fetchAssessmentStatus } from '@/packages/finance/services/records.uts'
|
||||
import { MatchView, fetchMatchDetailRecord, validRecordId } from '@/packages/finance/services/matches.uts'
|
||||
const { pageStyle, contentStyle } = usePageLayout()
|
||||
const assessmentId = ref(''); const productId = ref(''); const section = ref('actions'); const assessmentType = ref('')
|
||||
const revisionId = ref(''); const assessmentId = ref(''); const productId = ref(''); const section = ref('actions'); const assessmentType = ref('')
|
||||
const report = ref<AnalysisReport | null>(null); const match = ref<MatchView | null>(null)
|
||||
const loading = ref(false); const error = ref(''); const matchError = ref(''); const routeError = ref(''); const improveOpen = ref(false)
|
||||
const scrollTarget = ref('')
|
||||
@@ -69,7 +68,7 @@
|
||||
const reset = () => { report.value = null; match.value = null; assessmentType.value = ''; matchError.value = ''; loadedToken = ''; improveOpen.value = false; scrollTarget.value = '' }
|
||||
const home = () => { uni.reLaunch({ url: '/pages/home/home' }) }
|
||||
const history = () => { uni.navigateTo({ url: '/packages/finance/archive/archive' }) }
|
||||
const login = () => { uni.redirectTo({ url: '/packages/account/login/login?resumeNextStep=1&assessmentId=' + assessmentId.value + '&productId=' + productId.value + '§ion=' + section.value }) }
|
||||
const login = () => { uni.redirectTo({ url: '/packages/account/login/login?resumeNextStep=1&assessmentId=' + assessmentId.value + (revisionId.value.length > 0 ? '&revisionId=' + revisionId.value : '') + '&productId=' + productId.value + '§ion=' + section.value }) }
|
||||
// 离页或账户变更后,丢弃旧请求;重新进入必须重查归属和当前可用性。
|
||||
const stale = (request: number, token: string): boolean => {
|
||||
if (!visible || request != generation) return true
|
||||
@@ -87,17 +86,17 @@
|
||||
try {
|
||||
const status = await fetchAssessmentStatus(assessmentId.value)
|
||||
if (stale(request, token)) return
|
||||
if (status.id != assessmentId.value || status.status != 'succeeded' || !['personal', 'enterprise'].includes(status.type)) throw new Error('请从本人已成功生成的报告进入下一步行动。')
|
||||
const result = await fetchAnalysisReport(assessmentId.value)
|
||||
if (status.id != assessmentId.value || !status.hasReport || !['personal', 'enterprise'].includes(status.type)) throw new Error('请从本人已成功生成的报告进入下一步行动。')
|
||||
const result = await fetchAnalysisReport(assessmentId.value, revisionId.value)
|
||||
if (stale(request, token)) return
|
||||
report.value = result; assessmentType.value = status.type; loadedToken = token
|
||||
report.value = result; revisionId.value = result.revisionId; assessmentType.value = status.type; loadedToken = token
|
||||
if (productId.value.length > 0) {
|
||||
try {
|
||||
if (result.matching.status != 'completed') throw new Error('本报告没有可读取的产品匹配结果。')
|
||||
const detail = await fetchMatchDetailRecord(assessmentId.value, productId.value)
|
||||
const detail = await fetchMatchDetailRecord(assessmentId.value, productId.value, revisionId.value)
|
||||
if (stale(request, token)) return
|
||||
// 材料必须来自同次评估冻结产品,不允许用公共或其他报告产品补齐。
|
||||
if (detail.assessmentId != assessmentId.value || detail.resultVersion != result.version || detail.snapshotId != result.matching.snapshotId || detail.ruleVersion != result.matching.ruleVersion || detail.orderingVersion != result.matching.orderingVersion) throw new Error('产品与本报告的冻结版本不一致,请重新选择产品。')
|
||||
if (detail.assessmentId != assessmentId.value || detail.revisionId != result.revisionId || detail.resultVersion != result.version || detail.snapshotId != result.matching.snapshotId || detail.ruleVersion != result.matching.ruleVersion || detail.orderingVersion != result.matching.orderingVersion) throw new Error('产品与本报告的冻结版本不一致,请重新选择产品。')
|
||||
match.value = detail.item
|
||||
} catch (err) { if (!stale(request, token)) matchError.value = err instanceof Error ? err.message : '产品读取失败,请重试' }
|
||||
}
|
||||
@@ -110,12 +109,12 @@
|
||||
}
|
||||
}
|
||||
const ready = (): boolean => !stale(generation, loadedToken) && report.value != null && !loading.value
|
||||
const openReport = () => { if (ready()) uni.navigateTo({ url: '/packages/finance/report/report?assessmentId=' + assessmentId.value }) }
|
||||
const chooseProduct = () => { if (ready() && report.value!.matching.status == 'completed') uni.navigateTo({ url: '/packages/finance/matches/matches?assessmentId=' + assessmentId.value + '&group=eligible' }) }
|
||||
const openReport = () => { if (ready()) uni.navigateTo({ url: '/packages/finance/report/report?assessmentId=' + assessmentId.value + (revisionId.value.length > 0 ? '&revisionId=' + revisionId.value : '') }) }
|
||||
const chooseProduct = () => { if (ready() && report.value!.matching.status == 'completed') uni.navigateTo({ url: '/packages/finance/matches/matches?assessmentId=' + assessmentId.value + (revisionId.value.length > 0 ? '&revisionId=' + revisionId.value : '') + '&group=eligible' }) }
|
||||
const prepare = () => {
|
||||
if (!ready()) return
|
||||
if (section.value == 'prepare') { load(); return }
|
||||
uni.redirectTo({ url: nextStepRoute(assessmentId.value, productId.value, 'prepare') })
|
||||
uni.redirectTo({ url: nextStepRoute(assessmentId.value, productId.value, 'prepare', revisionId.value) })
|
||||
}
|
||||
const optimize = () => {
|
||||
if (!ready()) return
|
||||
@@ -126,21 +125,23 @@
|
||||
const consult = () => {
|
||||
if (!ready()) return
|
||||
if (productId.value.length > 0 && match.value == null) { uni.showToast({ title: '请先重新核对产品或从报告咨询AI', icon: 'none' }); return }
|
||||
uni.navigateTo({ url: assistantRoute(assessmentId.value, productId.value.length > 0 ? [productId.value] : [], 'next-step') })
|
||||
uni.navigateTo({ url: assistantRoute(assessmentId.value, productId.value.length > 0 ? [productId.value] : [], 'next-step', '', revisionId.value) })
|
||||
}
|
||||
const restart = () => {
|
||||
if (!ready() || !improveOpen.value) return
|
||||
clearAssessmentFlow()
|
||||
uni.navigateTo({ url: '/packages/finance/assessment/assessment?type=' + assessmentType.value })
|
||||
uni.navigateTo({ url: '/packages/finance/assessment/assessment?editId=' + assessmentId.value })
|
||||
}
|
||||
const back = () => {
|
||||
if (getCurrentPages().length > 1) uni.navigateBack()
|
||||
else if (validRecordId(assessmentId.value)) uni.redirectTo({ url: '/packages/finance/report/report?assessmentId=' + assessmentId.value })
|
||||
else if (validRecordId(assessmentId.value)) uni.redirectTo({ url: '/packages/finance/report/report?assessmentId=' + assessmentId.value + (revisionId.value.length > 0 ? '&revisionId=' + revisionId.value : '') })
|
||||
else history()
|
||||
}
|
||||
onLoad((options) => {
|
||||
revisionId.value = options?.['revisionId'] ?? '';
|
||||
if (revisionId.value.length > 0 && !validRecordId(revisionId.value)) routeError.value = '版本编号无效,请返回重新选择。'
|
||||
assessmentId.value = options?.['assessmentId'] ?? ''; productId.value = options?.['productId'] ?? ''; section.value = options?.['section'] ?? 'actions'
|
||||
if (nextStepRoute(assessmentId.value, productId.value, section.value).length == 0) routeError.value = '页面参数无效,请从本次报告或匹配产品重新进入。'
|
||||
if (nextStepRoute(assessmentId.value, productId.value, section.value, revisionId.value).length == 0) routeError.value = '页面参数无效,请从本次报告或匹配产品重新进入。'
|
||||
})
|
||||
onShow(() => { visible = true; load() })
|
||||
onHide(() => { visible = false; generation++; reset(); loading.value = false; error.value = '' })
|
||||
|
||||
Reference in New Issue
Block a user