Files
zkxw/web-admin/src/api/storage-release-review.ts
T

233 lines
5.4 KiB
TypeScript

import request from '@/utils/http'
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
import type { QcWorkOrderReceptionDetail } from '@/api/qc-work-order'
type PageList<T> = {
list: T[]
total: number
page: number
pageSize: number
totalPages: number
}
export type StorageReleaseReview = {
id: string
sampleCode?: string
sampleName?: string
labStorageCode?: string
protocolNo?: string
receptionSource?: string
receptionSourceLabel?: string
reviewConclusion?: string
reviewConclusionLabel?: string
reviewRemark?: string
reviewAttachments?: string
reviewBy?: string
reviewByName?: string
reviewTime?: string
qcReviewConclusion?: string
qcReviewConclusionLabel?: string
qcReviewRemark?: string
qcReviewAttachments?: string
qcReviewBy?: string
qcReviewByName?: string
qcReviewTime?: string
prodReviewConclusion?: string
prodReviewConclusionLabel?: string
prodReviewRemark?: string
prodReviewAttachments?: string
prodReviewBy?: string
prodReviewByName?: string
prodReviewTime?: string
storageStatus?: string
storageStatusLabel?: string
sampleTypeName?: string
handlerName?: string
receptionTime?: string
motherName?: string
protocolStatus?: string
protocolStatusLabel?: string
voidType?: string
isSpecial?: boolean
specialRemark?: string
storageBy?: string
storageByName?: string
storageTime?: string
remark?: string
createTime?: string
updateTime?: string
}
export type ProtocolInfo = {
protocolNo?: string
protocolStatus?: string
motherName?: string
motherPhone?: string
fatherName?: string
fatherPhone?: string
newbornName?: string
sampleCode?: string
sampleTypeName?: string
collectAmount?: number | null
storageYears?: number | null
isSpecial?: boolean
specialRemark?: string
voidType?: string
}
export type TransportInfo = {
transportType?: string
waybillNo?: string
expressFee?: number | null
etaTime?: string
carrierName?: string
carrierPhone?: string
}
export type ReceptionInfo = {
receptionTime?: string
handlerName?: string
receiveTemperature?: string
volumeMl?: number | null
netWeightG?: number | null
acceptConclusion?: string
labStorageCode?: string
}
export type QcInfoTask = {
id?: string
taskNo?: string
itemName?: string
taskType?: string
taskTypeLabel?: string
taskStatus?: string
taskStatusLabel?: string
conclusion?: string
conclusionLabel?: string
batchId?: string
thirdPartyAttachments?: string
attachmentFiles?: Array<{ id?: string; fileUrl?: string; fileName?: string; fileType?: string }>
results?: Array<{
paramName?: string
paramUnit?: string
paramValue?: string
}>
}
export type QcInfo = {
id?: string
workOrderNo?: string
workOrderStatus?: string
workOrderStatusLabel?: string
qcBizType?: string
qcBizTypeLabel?: string
triggerSource?: string
triggerSourceLabel?: string
cellProductCode?: string
cellProductName?: string
cellProductTypeName?: string
cellProductPassage?: string
cellProductSpecName?: string
productionWorkOrderId?: string
productionWorkOrderNo?: string
tasks?: QcInfoTask[]
inspectionBatches?: QcInspectionBatch[]
}
export type ProductionInfoTask = {
id?: string
taskNo?: string
taskName?: string
taskStatus?: string
taskStatusLabel?: string
conclusion?: string
conclusionLabel?: string
startedTime?: string
completedTime?: string
}
export type ProductionInfo = {
workOrderNo?: string
workOrderStatus?: string
workOrderStatusLabel?: string
tasks?: ProductionInfoTask[]
}
export type StorageReleaseReviewDetail = {
review: StorageReleaseReview
protocolInfo?: ProtocolInfo
transportInfo?: TransportInfo
receptionInfo?: ReceptionInfo
reception?: QcWorkOrderReceptionDetail
qcInfo?: QcInfo
processQcInfoList?: QcInfo[]
productionInfo?: ProductionInfo
}
export function fetchStorageReleaseReviewList(params?: {
page?: number
pageSize?: number
receptionSource?: string
reviewConclusion?: string
reviewSide?: 'overview' | 'production' | 'qc'
prodReviewConclusion?: string
qcReviewConclusion?: string
storageStatus?: string
keyword?: string
reviewPhase?: 'pending' | 'reviewed'
qcWorkOrderCompleted?: boolean
readyForReviewOnly?: boolean
}) {
return request.get<PageList<StorageReleaseReview>>({
url: '/web/admin/storage-release-reviews',
params
})
}
export function fetchStorageReleaseReviewDetail(id: string) {
return request.get<StorageReleaseReviewDetail>({
url: `/web/admin/storage-release-reviews/${id}`
})
}
export function submitStorageReleaseReview(
id: string,
data: {
reviewSide: 'production' | 'qc'
reviewConclusion: string
reviewRemark?: string
reviewAttachments?: string
}
) {
return request.put<StorageReleaseReview>({
url: `/web/admin/storage-release-reviews/${id}/review`,
data
})
}
export function batchReviewStorageRelease(data: {
ids: string[]
reviewSide: 'production' | 'qc'
reviewConclusion: string
reviewRemark?: string
reviewAttachments?: string
}) {
return request.put<void>({
url: '/web/admin/storage-release-reviews/batch-review',
data
})
}
export function storeSample(id: string) {
return request.put<StorageReleaseReview>({
url: `/web/admin/storage-release-reviews/${id}/store`
})
}
export function batchStoreSample(data: { ids: string[] }) {
return request.put<void>({
url: '/web/admin/storage-release-reviews/batch-store',
data
})
}