import request from '@/utils/http' import type { OutboundQcDetailApplication, OutboundQcDetailPatient, OutboundQcDetailInfusionPlan, OutboundQcDetailInfusionSchedule, OutboundQcDetailProduct } from '@/api/qc-work-order' import type { QcInspectionBatch } from '@/utils/qc-inspection-batch' type PageList = { list: T[] total: number page: number pageSize: number totalPages: number } export type OutboundReleaseReview = { id: string scheduleId?: string /** pilot_service=中试服务 clinical_application=临床应用 */ bizType?: string bizTypeLabel?: string applicationNo?: string projectTitle?: string customerName?: string patientName?: string cellType?: string specText?: string products?: OutboundQcDetailProduct[] infusionTime?: string scheduleStatus?: string scheduleStatusLabel?: string qcStatus?: string qcStatusLabel?: string reviewConclusion?: string reviewConclusionLabel?: string reviewRemark?: string reviewAttachments?: string reviewByName?: string reviewTime?: string createTime?: string updateTime?: string } export type { OutboundQcDetailApplication, OutboundQcDetailPatient, OutboundQcDetailInfusionPlan, OutboundQcDetailInfusionSchedule, OutboundQcDetailProduct } export type OutboundReviewInfo = { id?: string scheduleId?: string reviewConclusion?: string reviewRemark?: string reviewAttachments?: string reviewByName?: string reviewTime?: string } export type OutboundProductionTask = { id?: string taskNo?: string taskName?: string taskStatus?: string taskStatusLabel?: string conclusion?: string conclusionLabel?: string startedTime?: string completedTime?: string } export type OutboundProductionInfo = { workOrderNo?: string workOrderStatus?: string workOrderStatusLabel?: string tasks?: OutboundProductionTask[] } export type OutboundQcTask = { id?: string taskNo?: string itemName?: string taskType?: string taskTypeLabel?: string taskStatus?: string taskStatusLabel?: string conclusion?: string conclusionLabel?: string batchId?: string } export type OutboundQcInfo = { id?: string workOrderNo?: string workOrderStatus?: string workOrderStatusLabel?: string tasks?: OutboundQcTask[] inspectionBatches?: QcInspectionBatch[] } export type OutboundReleaseReviewDetail = { application?: OutboundQcDetailApplication patient?: OutboundQcDetailPatient infusionPlan?: OutboundQcDetailInfusionPlan infusionSchedule?: OutboundQcDetailInfusionSchedule products?: OutboundQcDetailProduct[] productionInfo?: OutboundProductionInfo qcInfo?: OutboundQcInfo processQcInfoList?: OutboundQcInfo[] reviewInfo?: OutboundReviewInfo outboundMaterial?: OutboundReleaseMaterialDetail } export type OutboundReleaseCellRow = { id?: string cellProductId?: string productCode?: string productName?: string productTypeName?: string specName?: string passage?: string batchNo?: string storageSlotName?: string productStatus?: string remark?: string } export type OutboundReleaseQcMaterialRow = { id?: string qcMaterialId?: string qty?: number materialCode?: string materialName?: string specModel?: string unit?: string remark?: string } export type OutboundReleasePaperRow = { id?: string paperName?: string copies?: number attachmentUrl?: string remark?: string } export type OutboundReleaseMaterialDetail = { id?: string infusionScheduleId?: string paperAttachments?: string paperMaterials?: OutboundReleasePaperRow[] remark?: string cells?: OutboundReleaseCellRow[] qcMaterials?: OutboundReleaseQcMaterialRow[] createTime?: string updateTime?: string } export function fetchOutboundReleaseReviewList(params?: { page?: number pageSize?: number scheduleStatus?: string reviewConclusion?: string qcStatus?: string keyword?: string /** pilot_service | clinical_application */ bizType?: string infusionTimeStart?: string infusionTimeEnd?: string }) { return request.get>({ url: '/web/admin/pilot-release-reviews', params }) } export function fetchOutboundReleaseReviewDetail(scheduleId: string) { return request.get({ url: `/web/admin/pilot-release-reviews/${scheduleId}/detail` }) } export function submitOutboundReleaseReview( scheduleId: string, data: { reviewConclusion: string reviewRemark?: string reviewAttachments?: string } ) { return request.put({ url: `/web/admin/pilot-release-reviews/${scheduleId}/review`, data }) } export function batchReviewOutboundRelease(data: { scheduleIds: string[] reviewConclusion: string reviewRemark?: string reviewAttachments?: string }) { return request.put({ url: '/web/admin/pilot-release-reviews/batch-review', data }) } export function fetchOutboundReleaseMaterial(scheduleId: string) { return request.get({ url: `/web/admin/pilot-release-reviews/${scheduleId}/outbound-materials` }) } export function fetchReleaseReviewList(params: { scheduleId: string }) { return request.get({ url: `/web/admin/pilot-release-reviews/${params.scheduleId}/detail` }) } export function updateReleaseReview(data: { id: string; reviewConclusion: string }) { return request.put({ url: `/web/admin/pilot-release-reviews/${data.id}/review`, data: { reviewConclusion: data.reviewConclusion } }) } export function deleteReleaseReview(data: { id: string }) { return request.delete({ url: `/web/admin/pilot-release-reviews/${data.id}` }) } export function saveOutboundReleaseMaterial( scheduleId: string, data: { paperMaterials?: { paperName: string; copies: number; attachmentUrl: string; remark?: string }[] remark?: string cells: { cellProductId: string; remark?: string }[] qcMaterials: { materialId: string; qty: number; remark?: string }[] } ) { return request.put({ url: `/web/admin/pilot-release-reviews/${scheduleId}/outbound-materials`, data }) }