提交
This commit is contained in:
1 parent
4daf990fab
commit
1ca2668112
219 files changed
+29817
-20945
No files matched your search
@@ -1417,6 +1417,12 @@ export function fetchStorageSlotList(params?: { facilityNodeId?: string; availab
|
||||
return request.get({ url: '/web/admin/storage-facility-slots', params })
|
||||
}
|
||||
|
||||
export function fetchStorageSlotStats() {
|
||||
return request.get<
|
||||
Array<{ facilityNodeId: string; total: number; occupied: number; empty: number }>
|
||||
>({ url: '/web/admin/storage-facility-slots/stats' })
|
||||
}
|
||||
|
||||
export function fetchStorageSlotSelectOptions(params?: {
|
||||
keyword?: string
|
||||
availableOnly?: boolean
|
||||
|
||||
@@ -29,6 +29,41 @@ export function fetchProductionTaskList(params?: {
|
||||
}>({ url: '/web/admin/production-tasks', params })
|
||||
}
|
||||
|
||||
/** 批量拉取当前页工单下的生产任务(含步骤摘要),POST 避免 GET URL 过长 */
|
||||
export function fetchProductionTasksByWorkOrderIds(workOrderIds: string[]) {
|
||||
const ids = workOrderIds.map((id) => String(id || '').trim()).filter(Boolean)
|
||||
if (!ids.length) {
|
||||
return Promise.resolve({ list: [] as any[], total: 0, page: 1, pageSize: 0, totalPages: 0 })
|
||||
}
|
||||
return request.post<{
|
||||
list: any[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}>({
|
||||
url: '/web/admin/production-tasks/list-by-work-orders',
|
||||
params: {
|
||||
workOrderIds: ids,
|
||||
includeStepSummary: true,
|
||||
pageSize: Math.min(500, ids.length * 100)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function groupProductionTasksByWorkOrderId(
|
||||
tasks: Record<string, any>[]
|
||||
): Record<string, Record<string, any>[]> {
|
||||
const map: Record<string, Record<string, any>[]> = {}
|
||||
for (const task of tasks || []) {
|
||||
const workOrderId = String(task.workOrderId || '').trim()
|
||||
if (!workOrderId) continue
|
||||
if (!map[workOrderId]) map[workOrderId] = []
|
||||
map[workOrderId].push(task)
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
export function fetchMyProductionTasks(params: {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
@@ -98,6 +133,33 @@ export function fetchProductionTaskDetail(
|
||||
return request.get<any>({ url: `/web/admin/production-tasks/${id}`, params })
|
||||
}
|
||||
|
||||
export type ProductionTaskEditorInitPayload = {
|
||||
task: Record<string, any>
|
||||
processLibrary?: Record<string, any>[]
|
||||
options?: {
|
||||
processCategories: Record<string, any>[]
|
||||
sops: Record<string, any>[]
|
||||
outputTypes: Record<string, any>[]
|
||||
equipments: Record<string, any>[]
|
||||
reagents: Record<string, any>[]
|
||||
consumables: Record<string, any>[]
|
||||
itemUnits: Record<string, any>[]
|
||||
}
|
||||
}
|
||||
|
||||
/** 编辑生产任务弹窗初始化(任务详情 + 工艺库 + 步骤配置参考数据,聚合为单次请求) */
|
||||
export function fetchProductionTaskEditorInit(
|
||||
id: string,
|
||||
options?: { includeReference?: boolean }
|
||||
) {
|
||||
const params =
|
||||
options?.includeReference === false ? { includeReference: false } : undefined
|
||||
return request.get<ProductionTaskEditorInitPayload>({
|
||||
url: `/web/admin/production-tasks/${id}/editor-init`,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchUpdateProductionTask(id: string, data: Record<string, any>) {
|
||||
return request.put({ url: `/web/admin/production-tasks/${id}`, params: data })
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ export interface ProductionWorkOrderItem {
|
||||
products?: OutboundQcDetailProduct[]
|
||||
paymentSummary?: QcProtocolPaymentSummary | null
|
||||
feeSummary?: QcBasicExperimentFeeSummary | null
|
||||
/** 细胞存储 / 科研捐赠:母亲姓名 */
|
||||
motherName?: string
|
||||
/** 细胞存储 / 科研捐赠:新生儿姓名 */
|
||||
newbornName?: string
|
||||
}
|
||||
|
||||
export type ProductionWorkOrderDetail = ProductionWorkOrderItem & {
|
||||
@@ -231,8 +235,31 @@ export function fetchProductionWorkOrderTabStepCounts() {
|
||||
})
|
||||
}
|
||||
|
||||
let manageTabStepCountsInflight: Promise<ProductionWorkOrderTabStepCounts> | null = null
|
||||
|
||||
/** 并发去重:Tab 栏与侧栏角标共享同一次 tab-step-counts 请求 */
|
||||
export function fetchProductionWorkOrderTabStepCountsDeduped() {
|
||||
if (!manageTabStepCountsInflight) {
|
||||
manageTabStepCountsInflight = fetchProductionWorkOrderTabStepCounts().finally(() => {
|
||||
manageTabStepCountsInflight = null
|
||||
})
|
||||
}
|
||||
return manageTabStepCountsInflight
|
||||
}
|
||||
|
||||
export function fetchMineProductionWorkOrderTabStepCounts() {
|
||||
return request.get<ProductionWorkOrderTabStepCounts>({
|
||||
url: '/web/admin/production-work-orders/mine-tab-step-counts'
|
||||
})
|
||||
}
|
||||
|
||||
let mineTabStepCountsInflight: Promise<ProductionWorkOrderTabStepCounts> | null = null
|
||||
|
||||
export function fetchMineProductionWorkOrderTabStepCountsDeduped() {
|
||||
if (!mineTabStepCountsInflight) {
|
||||
mineTabStepCountsInflight = fetchMineProductionWorkOrderTabStepCounts().finally(() => {
|
||||
mineTabStepCountsInflight = null
|
||||
})
|
||||
}
|
||||
return mineTabStepCountsInflight
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
import request from '@/utils/http'
|
||||
import type {
|
||||
QcBasicExperimentFeeSummary,
|
||||
QcProtocolPaymentSummary,
|
||||
OutboundQcDetailProduct
|
||||
} from '@/api/qc-work-order'
|
||||
|
||||
type PageList<T> = {
|
||||
list: T[]
|
||||
@@ -55,6 +60,9 @@ export type QcTask = {
|
||||
conclusionLabel?: string
|
||||
qcBizType?: string
|
||||
qcBizTypeLabel?: string
|
||||
receptionId?: string
|
||||
protocolSampleId?: string
|
||||
collectionProtocolId?: string
|
||||
receptionSource?: string
|
||||
receptionSourceLabel?: string
|
||||
protocolNo?: string
|
||||
@@ -84,6 +92,34 @@ export type QcTask = {
|
||||
remark?: string
|
||||
createTime?: string
|
||||
updateTime?: string
|
||||
/** 列表级工单摘要(我的任务接口批量 enrich) */
|
||||
triggerSource?: string
|
||||
triggerSourceLabel?: string
|
||||
hasLab?: boolean
|
||||
hasThirdParty?: boolean
|
||||
workOrderCreateTime?: string
|
||||
workOrderRemark?: string
|
||||
labStorageCode?: string
|
||||
applicationNo?: string
|
||||
applicationName?: string
|
||||
projectTitle?: string
|
||||
customerName?: string
|
||||
channelName?: string
|
||||
patientName?: string
|
||||
motherName?: string
|
||||
newbornName?: string
|
||||
infusionTime?: string
|
||||
sortNo?: number | null
|
||||
totalCourseCount?: number | null
|
||||
products?: OutboundQcDetailProduct[]
|
||||
cellType?: string
|
||||
specText?: string
|
||||
productionWorkOrderId?: string
|
||||
productionWorkOrderNo?: string
|
||||
bizType?: string
|
||||
bizTypeLabel?: string
|
||||
paymentSummary?: QcProtocolPaymentSummary | null
|
||||
feeSummary?: QcBasicExperimentFeeSummary | null
|
||||
}
|
||||
|
||||
export type QcTaskOperateScope = 'mine' | 'manage'
|
||||
|
||||
@@ -124,6 +124,10 @@ export type QcWorkOrder = {
|
||||
channelName?: string
|
||||
/** 出库工单:患者/用户姓名 */
|
||||
patientName?: string
|
||||
/** 入库工单(细胞存储/科研捐赠):母亲姓名 */
|
||||
motherName?: string
|
||||
/** 入库工单(细胞存储/科研捐赠):新生儿姓名 */
|
||||
newbornName?: string
|
||||
/** 出库工单:当前为第几次输注计划 */
|
||||
sortNo?: number | null
|
||||
/** 出库工单:输注计划总次数 */
|
||||
|
||||
Reference in new issue
Block a user