feat(project): add team attribution and business statistics

Add tenant-scoped teams and projects, order attribution across four businesses, conversion inheritance, scoped statistics and audited reassignment. Reuse existing Web and mobile UI patterns; team regions and hospitals remain informational.

Include incremental SQL and isolated regression coverage. Actual MySQL and browser/WebView integration validation remains pending; relates to issue #13.
This commit is contained in:
zlwu committed 2026-11-02 15:29:43 +08:00
1 parent e9df9d65e1
commit bd62416263
79 files changed
+3390 -25

No files matched your search

+2
View File
@@ -14,6 +14,8 @@ export type CollectionProtocolRow = Record<string, unknown>
export function fetchCollectionProtocolList(params?: {
page?: number
pageSize?: number
projectId?: string
teamId?: string
keyword?: string
protocolStatus?: string
createTimeStart?: string
+2
View File
@@ -10,6 +10,8 @@ type PageList<T> = {
export function fetchPresignOrderList(params?: {
page?: number
pageSize?: number
projectId?: string
teamId?: string
keyword?: string
orderStatus?: string
}) {
+66
View File
@@ -0,0 +1,66 @@
import request from '@/utils/http'
export type BizType =
| 'presign'
| 'cell_storage'
| 'research_donation'
| 'pilot_service'
| 'basic_experiment'
export const bizLabels: Record<BizType, string> = {
presign: '预签约',
cell_storage: '细胞存储',
research_donation: '科研捐赠',
pilot_service: '中试服务',
basic_experiment: '基础实验'
}
export type ProjectOption = {
id: string
projectName: string
projectNo: string
teamId: string
teamName: string
disabled?: boolean
}
export type ProjectRecord = Record<string, any>
const base = '/web/admin/project-management'
export const fetchProjectOptions = (params: {
bizType?: BizType
keyword?: string
usage?: 'filter'
currentProjectId?: string
}) =>
request.get<{ list: ProjectOption[]; required: boolean }>({
url: '/project-management/options',
params
})
export const fetchProjectReferences = () =>
request.get<{ users: ProjectRecord[]; regions: ProjectRecord[]; hospitals: ProjectRecord[] }>({
url: `${base}/references`
})
export const fetchManagementList = (kind: 'teams' | 'projects', params: Record<string, unknown>) =>
request.get<{ list: ProjectRecord[]; total: number }>({ url: `${base}/${kind}`, params })
export const fetchManagementDetail = (kind: 'teams' | 'projects', id: string) =>
request.get<ProjectRecord>({ url: `${base}/${kind}/${id}` })
export const saveManagement = (kind: 'teams' | 'projects', data: ProjectRecord, id?: string) =>
id
? request.put({ url: `${base}/${kind}/${id}`, data })
: request.post({ url: `${base}/${kind}`, data })
export const deleteManagement = (kind: 'teams' | 'projects', id: string) =>
request.del({ url: `${base}/${kind}/${id}` })
export const fetchProjectStatistics = (params: Record<string, unknown>) =>
request.get<{
items: ProjectRecord[]
totals: ProjectRecord
unassignedTotals: ProjectRecord
presignTotal: number
}>({ url: `${base}/statistics`, params })
export const fetchProjectRecords = (params: Record<string, unknown>) =>
request.get<{ list: ProjectRecord[]; total: number; statusCounts: Record<string, number> }>({
url: `${base}/records`,
params
})
export const previewAssignment = (data: ProjectRecord) =>
request.post<{ records: ProjectRecord[] }>({ url: `${base}/assignments/preview`, data })
export const saveAssignment = (data: ProjectRecord) =>
request.post({ url: `${base}/assignments`, data })
export const fetchAssignmentHistory = (params: ProjectRecord) =>
request.get<{ list: ProjectRecord[] }>({ url: `${base}/assignments/history`, params })
+2
View File
@@ -14,6 +14,8 @@ export type ResearchDonationRow = Record<string, unknown>
export function fetchResearchDonationList(params?: {
page?: number
pageSize?: number
projectId?: string
teamId?: string
keyword?: string
donationStatus?: string
createTimeStart?: string