ec-admin/src/api/catalog.ts
liuyun bb3f6e6020 fix(c0): 补齐 schedule/record/qc/document 占位页,api 导入统一 @/api/http
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-14 13:20:34 +08:00

72 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { http } from '@/api/http'
/** L2 属地目录项(有本地目录的州市)。 */
export interface SvcLocal {
id: string
locCode: string
localItemName: string
localCategory: string | null
svcTime: string | null
minFreq: string | null
staffQual: string | null
isMedical: boolean
sourceDoc: string | null
mapStatus: string
}
/** L1 国家基准库目录项(新建制州市无本地目录时回退全量)。 */
export interface SvcNational {
id: string
natCode: string
natName: string
natCategory: string
natSubCategory: string | null
recommendStaff: string | null
recommendDuration: string | null
isMedical: boolean
version: number
}
/** L4 机构项目库记录(机构勾选 + 配价)。 */
export interface SvcOrg {
id: string
tenantCode: string
srcType: string
srcId: string
isEnabled: boolean
price: string | null
priceEffective: number | null
isNewNational: boolean
createdAt: number
createdBy: string | null
updatedAt: number
deletedAt: number | null
}
/** 勾选 + 配价入参(机构只能改 isEnabled/price,其余业务字段只读)。 */
export interface ConfigSvcOrgData {
id: string
isEnabled?: boolean
price?: string
}
/** 按属地加载目录(L2 优先,无本地目录回退 L1 国家全量)。 */
export function listLocal(locCode: string, signal?: AbortSignal): Promise<SvcLocal[] | SvcNational[]> {
return http.get<SvcLocal[] | SvcNational[]>('/svc/local/list', { params: { loc_code: locCode }, signal })
}
/** 当前机构项目库(L4)。 */
export function listOrg(signal?: AbortSignal): Promise<SvcOrg[]> {
return http.get<SvcOrg[]>('/svc/org/list', { signal })
}
/** 勾选 + 配价。 */
export function configSvcOrg(data: ConfigSvcOrgData): Promise<SvcOrg> {
return http.post<SvcOrg>('/svc/org/config', data)
}
/** 国家新增项(昆明 L2 缺而 L1 有的过渡期新增,勾选界面需显式提示)。 */
export function listNewNational(signal?: AbortSignal): Promise<SvcNational[]> {
return http.get<SvcNational[]>('/svc/org/new-national', { signal })
}