136 lines
2.9 KiB
TypeScript
136 lines
2.9 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
type PageList<T> = {
|
|
list: T[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}
|
|
|
|
export type SampleReceptionCheckResult = {
|
|
itemCode: string
|
|
itemName: string
|
|
checked: boolean
|
|
checkItemId?: string
|
|
}
|
|
|
|
export type QcWorkOrderReceptionDetail = {
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
sampleTypeName?: string
|
|
sourceType?: string
|
|
sourceTypeLabel?: string
|
|
receptionTime?: string
|
|
handlerName?: string
|
|
receiveTemperature?: string
|
|
volumeMl?: number
|
|
netWeightG?: number
|
|
acceptConclusion?: string
|
|
acceptConclusionLabel?: string
|
|
remark?: string
|
|
etaTime?: string
|
|
transportType?: string
|
|
expressCompanyName?: string
|
|
waybillNo?: string
|
|
carrierName?: string
|
|
carrierPhone?: string
|
|
checkResults?: SampleReceptionCheckResult[]
|
|
receiveAttachments?: string
|
|
receiveAttachmentFiles?: Array<{
|
|
id?: string
|
|
fileUrl?: string
|
|
fileName?: string
|
|
fileType?: string
|
|
fileSize?: number
|
|
fileSizeDisplay?: string
|
|
}>
|
|
}
|
|
|
|
export type QcWorkOrder = {
|
|
id: string
|
|
workOrderNo: string
|
|
receptionId: string
|
|
protocolSampleId: string
|
|
collectionProtocolId: string
|
|
protocolNo: string
|
|
sampleCode: string
|
|
receptionSource?: string
|
|
receptionSourceLabel?: string
|
|
sampleTypeName?: string
|
|
receptionTime?: string
|
|
handlerName?: string
|
|
workOrderStatus: string
|
|
hasLab: boolean
|
|
hasThirdParty: boolean
|
|
configuredTime?: string
|
|
configuredBy?: string
|
|
thirdPartyFeeTotal?: number
|
|
remark?: string
|
|
createTime?: string
|
|
updateTime?: string
|
|
}
|
|
|
|
export type QcWorkOrderDetail = QcWorkOrder & {
|
|
reception?: QcWorkOrderReceptionDetail
|
|
labItems?: Array<{ id: string; labTestItemId: string; itemCode: string; itemName: string }>
|
|
thirdPartyItems?: Array<{
|
|
id: string
|
|
thirdPartyItemId: string
|
|
companyId: string
|
|
companyName: string
|
|
itemCode: string
|
|
itemName: string
|
|
feeAmount: number
|
|
}>
|
|
tasks?: Array<{
|
|
id: string
|
|
taskNo: string
|
|
taskType: string
|
|
itemCode?: string
|
|
itemName?: string
|
|
companyId?: string
|
|
companyName?: string
|
|
feeAmount?: number
|
|
taskStatus: string
|
|
conclusion?: string
|
|
conclusionLabel?: string
|
|
remark?: string
|
|
completedTime?: string
|
|
attachmentFiles?: Array<{ id?: string; fileUrl?: string; fileName?: string }>
|
|
}>
|
|
}
|
|
|
|
export function fetchQcWorkOrderList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
workOrderStatus?: string
|
|
}) {
|
|
return request.get<PageList<QcWorkOrder>>({
|
|
url: '/web/admin/qc-work-orders',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function fetchQcWorkOrderDetail(id: string) {
|
|
return request.get<QcWorkOrderDetail>({
|
|
url: `/web/admin/qc-work-orders/${id}`
|
|
})
|
|
}
|
|
|
|
export function fetchConfigureQcWorkOrder(
|
|
id: string,
|
|
data: {
|
|
hasLab: boolean
|
|
hasThirdParty: boolean
|
|
labItemIds: string[]
|
|
thirdPartyItemIds: string[]
|
|
}
|
|
) {
|
|
return request.post<QcWorkOrder>({
|
|
url: `/web/admin/qc-work-orders/${id}/configure`,
|
|
data
|
|
})
|
|
}
|