191 lines
5.4 KiB
TypeScript
191 lines
5.4 KiB
TypeScript
import request from '@/utils/http'
|
|
import type {
|
|
QcWorkOrderReceptionDetail,
|
|
OutboundQcDetailApplication,
|
|
OutboundQcDetailPatient,
|
|
OutboundQcDetailInfusionPlan,
|
|
OutboundQcDetailInfusionSchedule,
|
|
OutboundQcDetailProduct,
|
|
QcProtocolPaymentSummary,
|
|
QcBasicExperimentFeeSummary
|
|
} from '@/api/qc-work-order'
|
|
|
|
export interface ProductionWorkOrderItem {
|
|
id: string
|
|
workOrderNo: string
|
|
workOrderType?: string
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
receptionSource?: string
|
|
receptionSourceLabel?: string
|
|
sampleTypeName?: string
|
|
handlerName?: string
|
|
receptionTime?: string
|
|
workOrderStatus: string
|
|
createTime?: string
|
|
remark?: string
|
|
labStorageCode?: string
|
|
protocolStatus?: string
|
|
bizType?: string
|
|
bizTypeLabel?: string
|
|
/** 出库工单:关联申请单号 */
|
|
applicationNo?: string
|
|
applicationName?: string
|
|
channelName?: string
|
|
/** 出库工单:患者/用户姓名 */
|
|
patientName?: string
|
|
/** 出库工单:当前为第几次输注计划 */
|
|
sortNo?: number | null
|
|
/** 出库工单:输注计划总次数 */
|
|
totalCourseCount?: number | null
|
|
infusionTime?: string
|
|
/** 基础实验出库:课题名称(列表 enrich) */
|
|
projectTitle?: string
|
|
/** 基础实验出库:客户名称(列表 enrich) */
|
|
customerName?: string
|
|
/** 出库工单:输注计划细胞类型(列表 enrich,无产品明细时兜底) */
|
|
cellType?: string
|
|
/** 出库工单:输注计划规格(列表 enrich,无产品明细时兜底) */
|
|
specText?: string
|
|
/** 出库工单:输注计划关联细胞产品明细(列表 enrich) */
|
|
products?: OutboundQcDetailProduct[]
|
|
paymentSummary?: QcProtocolPaymentSummary | null
|
|
feeSummary?: QcBasicExperimentFeeSummary | null
|
|
}
|
|
|
|
export type ProductionWorkOrderDetail = ProductionWorkOrderItem & {
|
|
reception?: QcWorkOrderReceptionDetail
|
|
bizType?: string
|
|
bizTypeLabel?: string
|
|
/** 临床应用出库:简要申请单 */
|
|
pilotApplication?: {
|
|
applicationNo?: string
|
|
applicationName?: string
|
|
applicationStatus?: string
|
|
applicationStatusLabel?: string
|
|
}
|
|
/** 临床应用出库:简要输注计划 */
|
|
infusionSchedule?: {
|
|
cellType?: string
|
|
specText?: string
|
|
infusionTime?: string
|
|
infusionLocation?: string
|
|
infusionMethod?: string
|
|
scheduleStatus?: string
|
|
}
|
|
/** 中试服务出库:与出库质检工单查看弹窗一致 */
|
|
application?: OutboundQcDetailApplication
|
|
patient?: OutboundQcDetailPatient
|
|
infusionPlan?: OutboundQcDetailInfusionPlan
|
|
products?: OutboundQcDetailProduct[]
|
|
}
|
|
|
|
export function fetchProductionWorkOrderList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
workOrderStatus?: string
|
|
workOrderType?: string
|
|
receptionSource?: string
|
|
bizType?: string
|
|
createTimeStart?: string
|
|
createTimeEnd?: string
|
|
infusionTimeStart?: string
|
|
infusionTimeEnd?: string
|
|
}) {
|
|
return request.get<{
|
|
list: ProductionWorkOrderItem[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}>({ url: '/web/admin/production-work-orders', params })
|
|
}
|
|
|
|
export function fetchProductionWorkOrderDetail(id: string) {
|
|
return request.get<ProductionWorkOrderDetail>({ url: `/web/admin/production-work-orders/${id}` })
|
|
}
|
|
|
|
export function fetchCompleteProductionWorkOrder(id: string, data: Record<string, any>) {
|
|
return request.put({ url: `/web/admin/production-work-orders/${id}/complete`, params: data })
|
|
}
|
|
|
|
export function fetchCreateProductionWorkOrder(data: {
|
|
workOrderType?: string
|
|
protocolNo?: string
|
|
sampleCode?: string
|
|
receptionSource?: string
|
|
remark?: string
|
|
}) {
|
|
return request.post<ProductionWorkOrderItem>({
|
|
url: '/web/admin/production-work-orders',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchConfigureProductionWorkOrder(
|
|
id: string,
|
|
data: {
|
|
taskName?: string
|
|
taskType?: string
|
|
routeId?: string
|
|
description?: string
|
|
remark?: string
|
|
}
|
|
) {
|
|
return request.post<ProductionWorkOrderItem>({
|
|
url: `/web/admin/production-work-orders/${id}/configure`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchUpdateProductionWorkOrder(id: string, data: { remark?: string }) {
|
|
return request.put<ProductionWorkOrderItem>({
|
|
url: `/web/admin/production-work-orders/${id}`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchDeleteProductionWorkOrder(id: string) {
|
|
return request.del({ url: `/web/admin/production-work-orders/${id}` })
|
|
}
|
|
|
|
export interface ProductionQcDispatchOption {
|
|
id: string
|
|
stepOutputId?: string
|
|
taskId?: string
|
|
taskNo?: string
|
|
taskName?: string
|
|
stepId?: string
|
|
processName?: string
|
|
outputTypeId?: string
|
|
outputTypeName?: string
|
|
outputName?: string
|
|
outputBarcode?: string
|
|
cellProductId?: string
|
|
}
|
|
|
|
/** @deprecated 使用 ProductionQcDispatchOption */
|
|
export type ProductionCellProductOption = ProductionQcDispatchOption
|
|
|
|
export function fetchProductionWorkOrderQcDispatchOptions(workOrderId: string) {
|
|
return request.get<ProductionQcDispatchOption[]>({
|
|
url: `/web/admin/production-work-orders/${workOrderId}/cell-product-options`
|
|
})
|
|
}
|
|
|
|
/** @deprecated 使用 fetchProductionWorkOrderQcDispatchOptions */
|
|
export function fetchProductionWorkOrderCellProductOptions(workOrderId: string) {
|
|
return fetchProductionWorkOrderQcDispatchOptions(workOrderId)
|
|
}
|
|
|
|
export function fetchCreateQcFromProduction(
|
|
workOrderId: string,
|
|
data: { productionStepOutputId: string; remark?: string }
|
|
) {
|
|
return request.post({
|
|
url: `/web/admin/production-work-orders/${workOrderId}/qc-work-orders`,
|
|
data
|
|
})
|
|
}
|