实现结果总览详情资产和征信页签
This commit is contained in:
@@ -64,10 +64,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
|
||||
@@ -97,19 +133,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: {
|
||||
@@ -148,6 +189,14 @@ export default {
|
||||
detailLoading: false,
|
||||
detailError: "",
|
||||
detailData: null,
|
||||
assetLoading: false,
|
||||
assetError: "",
|
||||
assetDetail: null,
|
||||
assetLoaded: false,
|
||||
creditLoading: false,
|
||||
creditError: "",
|
||||
creditDetail: createEmptyCreditDetail(),
|
||||
creditLoaded: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -186,6 +235,14 @@ export default {
|
||||
this.fetchDetailData();
|
||||
}
|
||||
},
|
||||
projectId() {
|
||||
this.resetAssetDetailState();
|
||||
this.resetCreditDetailState();
|
||||
},
|
||||
person() {
|
||||
this.resetAssetDetailState();
|
||||
this.resetCreditDetailState();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
resetDialogState() {
|
||||
@@ -194,6 +251,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)
|
||||
@@ -224,6 +295,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) || {
|
||||
@@ -251,6 +371,12 @@ export default {
|
||||
});
|
||||
},
|
||||
handleTabChange() {
|
||||
if (this.activeTab === "assetAnalysis") {
|
||||
this.fetchAssetDetailData();
|
||||
}
|
||||
if (this.activeTab === "creditDetail") {
|
||||
this.fetchCreditDetailData();
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
const tabRef = this.activeTab === "relationshipGraph"
|
||||
? this.$refs.relationshipGraphTab
|
||||
|
||||
@@ -193,12 +193,12 @@ export const projectAnalysisTabs = [
|
||||
{
|
||||
key: "assetAnalysis",
|
||||
label: "资产分析",
|
||||
description: "静态承载资产分析页签内容,本轮不接入新接口。",
|
||||
description: "展示员工家庭资产负债专项核查资产详情。",
|
||||
},
|
||||
{
|
||||
key: "creditSummary",
|
||||
label: "征信摘要",
|
||||
description: "静态承载征信摘要页签内容,本轮不接入新接口。",
|
||||
key: "creditDetail",
|
||||
label: "征信详情",
|
||||
description: "展示征信信息维护中的征信详情。",
|
||||
},
|
||||
{
|
||||
key: "relationshipGraph",
|
||||
|
||||
Reference in New Issue
Block a user