实现结果总览详情资产和征信页签

This commit is contained in:
wkc
2026-06-02 17:17:49 +08:00
parent 457e6c1d27
commit d45e9410ef
15 changed files with 433 additions and 85 deletions

View File

@@ -54,10 +54,46 @@
/>
</el-tab-pane>
<el-tab-pane label="资产分析" name="assetAnalysis">
<project-analysis-placeholder-tab :tab-data="getTabData('assetAnalysis')" />
<div class="project-analysis-tab-panel">
<el-alert
v-if="assetError"
:closable="false"
class="project-analysis-layout__alert"
type="error"
show-icon
:title="assetError"
>
<template slot="default">
<el-button type="text" size="mini" @click="fetchAssetDetailData">重试</el-button>
</template>
</el-alert>
<family-asset-liability-detail
v-else
:detail="assetDetail"
:loading="assetLoading"
/>
</div>
</el-tab-pane>
<el-tab-pane label="征信摘要" name="creditSummary">
<project-analysis-placeholder-tab :tab-data="getTabData('creditSummary')" />
<el-tab-pane label="征信详情" name="creditDetail">
<div class="project-analysis-tab-panel">
<el-alert
v-if="creditError"
:closable="false"
class="project-analysis-layout__alert"
type="error"
show-icon
:title="creditError"
>
<template slot="default">
<el-button type="text" size="mini" @click="fetchCreditDetailData">重试</el-button>
</template>
</el-alert>
<credit-info-detail
v-else
:detail="creditDetail"
:loading="creditLoading"
/>
</div>
</el-tab-pane>
<el-tab-pane label="关系图谱" name="relationshipGraph">
<project-analysis-fund-flow-tab
@@ -87,19 +123,24 @@
</template>
<script>
import { getCreditInfoDetail } from "@/api/ccdiCreditInfo";
import { getFamilyAssetLiabilityDetail } from "@/api/ccdi/projectSpecialCheck";
import { getOverviewPersonAnalysisDetail } from "@/api/ccdi/projectOverview";
import CreditInfoDetail from "@/views/ccdiCreditInfo/components/CreditInfoDetail.vue";
import { createEmptyCreditDetail, normalizeCreditDetail } from "@/views/ccdiCreditInfo/components/creditDetailViewModel.js";
import FamilyAssetLiabilityDetail from "./FamilyAssetLiabilityDetail";
import ProjectAnalysisAbnormalTab from "./ProjectAnalysisAbnormalTab";
import ProjectAnalysisFundFlowTab from "./ProjectAnalysisFundFlowTab";
import ProjectAnalysisPlaceholderTab from "./ProjectAnalysisPlaceholderTab";
import ProjectAnalysisSidebar from "./ProjectAnalysisSidebar";
import { buildProjectAnalysisDialogData } from "./preliminaryCheck.mock";
export default {
name: "ProjectAnalysisDialog",
components: {
CreditInfoDetail,
FamilyAssetLiabilityDetail,
ProjectAnalysisAbnormalTab,
ProjectAnalysisFundFlowTab,
ProjectAnalysisPlaceholderTab,
ProjectAnalysisSidebar,
},
props: {
@@ -137,6 +178,14 @@ export default {
detailLoading: false,
detailError: "",
detailData: null,
assetLoading: false,
assetError: "",
assetDetail: null,
assetLoaded: false,
creditLoading: false,
creditError: "",
creditDetail: createEmptyCreditDetail(),
creditLoaded: false,
};
},
computed: {
@@ -175,6 +224,14 @@ export default {
this.fetchDetailData();
}
},
projectId() {
this.resetAssetDetailState();
this.resetCreditDetailState();
},
person() {
this.resetAssetDetailState();
this.resetCreditDetailState();
},
},
methods: {
resetDialogState() {
@@ -182,6 +239,20 @@ export default {
this.detailLoading = false;
this.detailError = "";
this.detailData = null;
this.resetAssetDetailState();
this.resetCreditDetailState();
},
resetAssetDetailState() {
this.assetLoading = false;
this.assetError = "";
this.assetDetail = null;
this.assetLoaded = false;
},
resetCreditDetailState() {
this.creditLoading = false;
this.creditError = "";
this.creditDetail = createEmptyCreditDetail();
this.creditLoaded = false;
},
resolveStaffIdCard() {
return (this.modelSummary && this.modelSummary.staffIdCard)
@@ -212,6 +283,55 @@ export default {
handleRetryDetail() {
this.fetchDetailData();
},
async fetchAssetDetailData() {
if (this.assetLoaded || this.assetLoading) {
return;
}
const staffIdCard = this.resolveStaffIdCard();
if (!this.projectId || !staffIdCard) {
this.assetError = "缺少项目或人员身份证号,无法加载资产详情";
return;
}
this.assetLoading = true;
this.assetError = "";
try {
const response = await getFamilyAssetLiabilityDetail(this.projectId, staffIdCard);
this.assetDetail = (response && response.data) || {};
this.assetLoaded = true;
} catch (error) {
this.assetDetail = null;
this.assetLoaded = false;
this.assetError = "资产详情加载失败,请稍后重试";
console.error("加载资产详情失败", error);
} finally {
this.assetLoading = false;
}
},
async fetchCreditDetailData() {
if (this.creditLoaded || this.creditLoading) {
return;
}
const staffIdCard = this.resolveStaffIdCard();
if (!staffIdCard) {
this.creditError = "缺少人员身份证号,无法加载征信详情";
return;
}
this.creditLoading = true;
this.creditError = "";
try {
const response = await getCreditInfoDetail(staffIdCard);
const data = (response && response.data) || {};
this.creditDetail = normalizeCreditDetail(data);
this.creditLoaded = true;
} catch (error) {
this.creditDetail = createEmptyCreditDetail();
this.creditLoaded = false;
this.creditError = "征信详情加载失败,请稍后重试";
console.error("加载征信详情失败", error);
} finally {
this.creditLoading = false;
}
},
getTabData(tabKey) {
return (
this.dialogData.tabs.find((item) => item.key === tabKey) || {
@@ -225,6 +345,12 @@ export default {
this.$emit("close");
},
handleTabChange() {
if (this.activeTab === "assetAnalysis") {
this.fetchAssetDetailData();
}
if (this.activeTab === "creditDetail") {
this.fetchCreditDetailData();
}
this.$nextTick(() => {
const tabRef = this.activeTab === "relationshipGraph"
? this.$refs.relationshipGraphTab