diff --git a/.env.development b/.env.development index b8ccd8b..fbcc74b 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_NAME=后台管理(开发环境) -#VITE_API_URL=http://127.0.0.1:9200/api +VITE_API_URL=http://127.0.0.1:9200/api #VITE_SERVER_API_URL=http://127.0.0.1:8000/api diff --git a/src/api/credit/creditCompany/model/index.ts b/src/api/credit/creditCompany/model/index.ts index e1043c8..79ddaa5 100644 --- a/src/api/credit/creditCompany/model/index.ts +++ b/src/api/credit/creditCompany/model/index.ts @@ -108,6 +108,56 @@ export interface CreditCompany { cechnologyLevel?: string; // 是否小微企业 smallEnterprise?: string; + // 记录数 + creditAdministrativeLicense?: number; + // 记录数 + creditBankruptcy?: number; + // 记录数 + creditBranch?: number; + // 记录数 + creditBreachOfTrust?: number; + // 记录数 + creditCaseFiling?: number; + // 记录数 + creditCompetitor?: number; + // 记录数 + creditCourtAnnouncement?: number; + // 记录数 + creditCourtSession?: number; + // 记录数 + creditCustomer?: number; + // 记录数 + creditDeliveryNotice?: number; + // 记录数 + creditExternal?: number; + // 记录数 + creditFinalVersion?: number; + // 记录数 + creditGqdj?: number; + // 记录数 + creditHistoricalLegalPerson?: number; + // 记录数 + creditJudgmentDebtor?: number; + // 记录数 + creditJudicialDocument?: number; + // 记录数 + creditJudiciary?: number; + // 记录数 + creditMediation?: number; + // 记录数 + creditNearbyCompany?: number; + // 记录数 + creditPatent?: number; + // 记录数 + creditRiskRelation?: number; + // 记录数 + creditSupplier?: number; + // 记录数 + creditSuspectedRelationship?: number; + // 记录数 + creditUser?: number; + // 记录数 + creditXgxf?: number; // 备注 comments?: string; // 是否推荐 diff --git a/src/views/credit/creditCompany/components/creditCompanyInfo.vue b/src/views/credit/creditCompany/components/creditCompanyInfo.vue index db43004..89ed995 100644 --- a/src/views/credit/creditCompany/components/creditCompanyInfo.vue +++ b/src/views/credit/creditCompany/components/creditCompanyInfo.vue @@ -40,7 +40,16 @@ :tabBarGutter="9" class="credit-company-tabs" > - + + = { + 招投标: 'creditUser', + 对外投资: 'creditExternal', + 风险关系: 'creditRiskRelation', + 竞争对手: 'creditCompetitor', + 供应商: 'creditSupplier', + 客户: 'creditCustomer', + 司法案件: 'creditJudiciary', + 被执行人: 'creditJudgmentDebtor', + 限制高消费: 'creditXgxf', + 终本案件: 'creditFinalVersion', + 开庭公告: 'creditCourtSession', + 法院公告: 'creditCourtAnnouncement', + 失信被执行人: 'creditBreachOfTrust', + 裁判文书: 'creditJudicialDocument', + 立案信息: 'creditCaseFiling', + 诉前调解: 'creditMediation', + 送达公告: 'creditDeliveryNotice', + 股权冻结: 'creditGqdj', + 附近企业: 'creditNearbyCompany', + 分支机构: 'creditBranch', + 破产重整: 'creditBankruptcy', + 行政许可: 'creditAdministrativeLicense', + 疑似关系: 'creditSuspectedRelationship', + 专利: 'creditPatent', + 历史法定代表人: 'creditHistoricalLegalPerson' + }; + type TabApiConfig = { page: ( params: any @@ -436,7 +477,9 @@ 'recommend', 'url', 'comments', - 'companyId' + 'companyId', + // Backend flag; do not show in tables. + 'hasData' ]); const commonTitleMap: Record = { @@ -1183,6 +1226,7 @@ }; const tabState = reactive>({}); + const tabHasData = reactive>({}); tabList.forEach((tab) => { tabState[tab.key] = { loading: false, @@ -1195,6 +1239,7 @@ }, loadedSignature: undefined }; + tabHasData[tab.key] = false; }); const activeTab = ref(tabList[0].key); @@ -1492,6 +1537,29 @@ tabState[tab.key].loading = false; tabState[tab.key].loadedSignature = undefined; resetTabPagination(tab.key); + tabHasData[tab.key] = false; + }); + }; + + const normalizeHasData = ( + res: any, + list: Record[], + total: number + ) => { + const hasDataRaw = + res?.hasData ?? (list.length ? (list[0] as any)?.hasData : undefined); + return ( + Number(hasDataRaw) === 1 || + list.some((row) => Number((row as any)?.hasData) === 1) || + (total ?? 0) > 0 + ); + }; + + const syncTabsHasDataFromCounts = () => { + tabList.forEach((tab) => { + const field = tabCountFieldMap[tab.key]; + const raw = (form as any)?.[field] ?? (props.data as any)?.[field] ?? 0; + tabHasData[tab.key] = Number(raw) > 0; }); }; @@ -1546,7 +1614,13 @@ } state.pagination.total = res?.count ?? 0; + // Keep the count field in sync (only when backend returns a count), so Tab highlight can update after import/refresh. + const countField = tabCountFieldMap[key]; + if (countField && typeof (res as any)?.count === 'number') { + (form as any)[countField] = (res as any).count; + } state.data = list; + tabHasData[key] = normalizeHasData(res as any, list, state.pagination.total); if (!state.columns.length) { state.columns = buildColumns(key, state.data); } @@ -1584,6 +1658,7 @@ assignObject(form, props.data); } activeTab.value = tabList[0].key; + syncTabsHasDataFromCounts(); loadTabData(activeTab.value, true); } else { showRelatedImport.value = false; @@ -1604,7 +1679,16 @@ resetForm(); clearTabData(); assignObject(form, data); + syncTabsHasDataFromCounts(); loadTabData(activeTab.value, true); } ); + +