120 lines
2.8 KiB
TypeScript
120 lines
2.8 KiB
TypeScript
import request from '@/utils/http'
|
||
|
||
type PageList<T> = {
|
||
list: T[]
|
||
total: number
|
||
page: number
|
||
pageSize: number
|
||
totalPages: number
|
||
}
|
||
|
||
export function fetchSampleReceptionPendingList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
sourceType?: string
|
||
etaTimeStart?: string
|
||
etaTimeEnd?: string
|
||
}) {
|
||
return request.get<PageList<Record<string, unknown>>>({
|
||
url: '/web/admin/sample-receptions/pending',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchSampleReceptionReceivedList(params?: {
|
||
page?: number
|
||
pageSize?: number
|
||
keyword?: string
|
||
sourceType?: string
|
||
sampleTypeId?: string
|
||
/** true=已作废(yzf),false=非已作废,不传=全部 */
|
||
isVoided?: boolean
|
||
receptionTimeStart?: string
|
||
receptionTimeEnd?: string
|
||
}) {
|
||
return request.get<PageList<Record<string, unknown>>>({
|
||
url: '/web/admin/sample-receptions/received',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function fetchSampleReceptionDetail(receptionId: string) {
|
||
return request.get<Record<string, unknown>>({
|
||
url: `/web/admin/sample-receptions/${receptionId}`
|
||
})
|
||
}
|
||
|
||
export function fetchAllocateLabStorageCodes(data: { receptionDate: string; count?: number }) {
|
||
return request.post<{ codes: string[] }>({
|
||
url: '/web/admin/sample-receptions/allocate-lab-storage-codes',
|
||
data
|
||
})
|
||
}
|
||
|
||
export type SampleReceptionCheckResult = {
|
||
id?: string
|
||
checkItemId?: string
|
||
itemCode: string
|
||
itemName: string
|
||
checked: boolean
|
||
orderNum?: number
|
||
}
|
||
|
||
export function fetchSampleReceptionUpdate(
|
||
receptionId: string,
|
||
data: {
|
||
receptionTime: string
|
||
handlerUserId?: string
|
||
handlerName?: string
|
||
receiveTemperature?: string
|
||
checks: Array<{ checkItemId: string; checked: boolean }>
|
||
acceptConclusion: 'js' | 'bj'
|
||
receiveAttachments?: string
|
||
remark?: string
|
||
labStorageCode?: string
|
||
}
|
||
) {
|
||
return request.put({
|
||
url: `/web/admin/sample-receptions/${receptionId}`,
|
||
data
|
||
})
|
||
}
|
||
|
||
export function fetchSampleReceptionSubmit(data: {
|
||
protocolSampleId?: string
|
||
sourceType?: 'cell_storage' | 'research_donation'
|
||
donationSampleId?: string
|
||
receptionTime: string
|
||
handlerUserId?: string
|
||
handlerName?: string
|
||
receiveTemperature?: string
|
||
checks: Array<{ checkItemId: string; checked: boolean }>
|
||
acceptConclusion: 'js' | 'bj'
|
||
receiveAttachments?: string
|
||
remark?: string
|
||
labStorageCode?: string
|
||
}) {
|
||
return request.post({
|
||
url: '/web/admin/sample-receptions',
|
||
data
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 根据样本编码查询样本接收记录
|
||
* @returns 包含 receptionId(有记录时)和 sampleInfo(样本信息)的对象;无记录时 receptionId 为空
|
||
*/
|
||
export function fetchSampleReceptionBySampleCode(params: {
|
||
sampleCode: string
|
||
sourceType?: string
|
||
}) {
|
||
return request.get<{
|
||
receptionId?: string
|
||
sampleInfo?: Record<string, unknown> | null
|
||
}>({
|
||
url: '/web/admin/sample-receptions/by-sample-code',
|
||
params
|
||
})
|
||
}
|