提交
This commit is contained in:
1 parent
a9667f00cc
commit
817dfff43c
174 files changed
+17383
-14508
No files matched your search
@@ -204,7 +204,7 @@ const CARD_META_BY_TAB: Record<ProductionWorkOrderTabKey, ProductionWorkOrderCar
|
||||
showProtocolFeeSummary: false,
|
||||
showOutboundFeeSummary: false,
|
||||
metaFields: outboundPilotClinicalFields,
|
||||
allowDispatchQc: false,
|
||||
allowDispatchQc: true,
|
||||
allowSampleReception: false,
|
||||
allowDispatchComplete: true,
|
||||
allowEditRemark: true,
|
||||
@@ -215,7 +215,7 @@ const CARD_META_BY_TAB: Record<ProductionWorkOrderTabKey, ProductionWorkOrderCar
|
||||
showProtocolFeeSummary: false,
|
||||
showOutboundFeeSummary: true,
|
||||
metaFields: outboundBasicExperimentFields,
|
||||
allowDispatchQc: false,
|
||||
allowDispatchQc: true,
|
||||
allowSampleReception: false,
|
||||
allowDispatchComplete: true,
|
||||
allowEditRemark: true,
|
||||
|
||||
@@ -140,10 +140,10 @@ export function filterTimeLabelForTab(tab: ProductionWorkOrderTabConfig): string
|
||||
export function filterTimeHintForTab(tab: ProductionWorkOrderTabConfig): string {
|
||||
if (tab.group === 'outbound') {
|
||||
return tab.key === 'outbound_basic_experiment'
|
||||
? '默认展示近 30 天内交付的工单。'
|
||||
: '默认展示近 30 天内输注的工单。'
|
||||
? '支持按交付时间筛选。'
|
||||
: '支持按输注时间筛选。'
|
||||
}
|
||||
return '默认展示近 30 天内创建的工单。'
|
||||
return '支持按创建时间筛选。'
|
||||
}
|
||||
|
||||
export function workOrderMatchesTab(
|
||||
|
||||
@@ -70,7 +70,7 @@ export function filterMineEntriesByWorkOrderSearch(
|
||||
const row = entry.workOrder
|
||||
if (resolveTabKeyFromWorkOrder(row) !== tabKey) return false
|
||||
if (filters.workOrderStatus && row.workOrderStatus !== filters.workOrderStatus) return false
|
||||
if (tab.group === 'inbound' && filters.triggerSource && row.triggerSource !== filters.triggerSource) {
|
||||
if (tab.listLayout !== 'standalone' && filters.triggerSource && row.triggerSource !== filters.triggerSource) {
|
||||
return false
|
||||
}
|
||||
if (!keywordMatchesWorkOrder(row, filters.keyword || '', tabKey)) return false
|
||||
|
||||
@@ -28,7 +28,7 @@ export type CardMetaField = {
|
||||
|
||||
export type QcWorkOrderCardMetaConfig = {
|
||||
tabKey: QcWorkOrderTabKey
|
||||
listLayout: 'inbound-grouped' | 'standalone'
|
||||
listLayout: 'inbound-grouped' | 'outbound-grouped' | 'standalone'
|
||||
showTriggerTag: boolean
|
||||
showProtocolFeeSummary: boolean
|
||||
showOutboundFeeSummary: boolean
|
||||
@@ -174,6 +174,34 @@ function buildDonationGroupContext(row: QcWorkOrder): string[] {
|
||||
return parts
|
||||
}
|
||||
|
||||
const outboundGroupedFields: CardMetaField[] = [
|
||||
{ label: '质检对象', getValue: formatQcTarget, colSpan: 2 },
|
||||
{
|
||||
label: '关联生产工单',
|
||||
getValue: (row) => row.productionWorkOrderNo || '—',
|
||||
visible: (row) => (row.triggerSource || 'reception') === 'production'
|
||||
},
|
||||
...commonTailFields
|
||||
]
|
||||
|
||||
function buildOutboundPilotGroupContext(row: QcWorkOrder): string[] {
|
||||
const parts: string[] = []
|
||||
if (row.applicationName) parts.push(row.applicationName)
|
||||
if (row.channelName) parts.push(row.channelName)
|
||||
if (row.patientName) parts.push(row.patientName)
|
||||
if (row.infusionTime) parts.push(`输注 ${row.infusionTime}`)
|
||||
return parts
|
||||
}
|
||||
|
||||
function buildOutboundBasicExperimentGroupContext(row: QcWorkOrder): string[] {
|
||||
const parts: string[] = []
|
||||
const title = row.projectTitle || row.applicationName
|
||||
if (title) parts.push(title)
|
||||
if (row.customerName) parts.push(row.customerName)
|
||||
if (row.infusionTime) parts.push(`交付 ${row.infusionTime}`)
|
||||
return parts
|
||||
}
|
||||
|
||||
const CARD_META_BY_TAB: Record<QcWorkOrderTabKey, QcWorkOrderCardMetaConfig> = {
|
||||
inbound_cell_storage: {
|
||||
tabKey: 'inbound_cell_storage',
|
||||
@@ -201,24 +229,24 @@ const CARD_META_BY_TAB: Record<QcWorkOrderTabKey, QcWorkOrderCardMetaConfig> = {
|
||||
},
|
||||
outbound_pilot_service: {
|
||||
tabKey: 'outbound_pilot_service',
|
||||
listLayout: 'standalone',
|
||||
showTriggerTag: false,
|
||||
listLayout: 'outbound-grouped',
|
||||
showTriggerTag: true,
|
||||
showProtocolFeeSummary: false,
|
||||
showOutboundFeeSummary: false,
|
||||
metaFields: outboundPilotClinicalFields,
|
||||
buildGroupContextParts: () => [],
|
||||
metaFields: outboundGroupedFields,
|
||||
buildGroupContextParts: buildOutboundPilotGroupContext,
|
||||
allowEditTemporary: false,
|
||||
allowEditRemark: true,
|
||||
allowDelete: false
|
||||
},
|
||||
outbound_basic_experiment: {
|
||||
tabKey: 'outbound_basic_experiment',
|
||||
listLayout: 'standalone',
|
||||
showTriggerTag: false,
|
||||
listLayout: 'outbound-grouped',
|
||||
showTriggerTag: true,
|
||||
showProtocolFeeSummary: false,
|
||||
showOutboundFeeSummary: true,
|
||||
metaFields: outboundBasicExperimentFields,
|
||||
buildGroupContextParts: () => [],
|
||||
metaFields: outboundGroupedFields,
|
||||
buildGroupContextParts: buildOutboundBasicExperimentGroupContext,
|
||||
allowEditTemporary: false,
|
||||
allowEditRemark: true,
|
||||
allowDelete: false
|
||||
@@ -261,3 +289,12 @@ export function buildGroupContextSubtitle(row: QcWorkOrder, tabKey: QcWorkOrderT
|
||||
export function cardMetaUsesInboundGroups(tabKey: QcWorkOrderTabKey): boolean {
|
||||
return getQcWorkOrderTab(tabKey)?.listLayout === 'inbound-grouped'
|
||||
}
|
||||
|
||||
export function cardMetaUsesOutboundGroups(tabKey: QcWorkOrderTabKey): boolean {
|
||||
return getQcWorkOrderTab(tabKey)?.listLayout === 'outbound-grouped'
|
||||
}
|
||||
|
||||
export function cardMetaUsesGroupedList(tabKey: QcWorkOrderTabKey): boolean {
|
||||
const layout = getQcWorkOrderTab(tabKey)?.listLayout
|
||||
return layout === 'inbound-grouped' || layout === 'outbound-grouped'
|
||||
}
|
||||
@@ -2,12 +2,16 @@ import type { QcWorkOrder } from '@/api/qc-work-order'
|
||||
|
||||
export type QcWorkOrderSampleGroupModel = {
|
||||
groupKey: string
|
||||
/** 入库:样本编码;出库:申请单号等分组主标题 */
|
||||
sampleCode: string
|
||||
groupTitle?: string
|
||||
workOrders: QcWorkOrder[]
|
||||
}
|
||||
|
||||
function triggerSortWeight(row: QcWorkOrder) {
|
||||
return (row.triggerSource || 'reception') === 'reception' ? 0 : 1
|
||||
const ts = row.triggerSource || 'reception'
|
||||
if (ts === 'production') return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function sortWorkOrdersInGroup(rows: QcWorkOrder[]) {
|
||||
@@ -37,6 +41,37 @@ export function groupInboundQcWorkOrders(rows: QcWorkOrder[]): QcWorkOrderSample
|
||||
})
|
||||
}
|
||||
|
||||
/** 出库 Tab:按输注计划分组 */
|
||||
export function groupOutboundQcWorkOrders(rows: QcWorkOrder[]): QcWorkOrderSampleGroupModel[] {
|
||||
const map = new Map<string, QcWorkOrder[]>()
|
||||
for (const row of rows) {
|
||||
const key = (row.infusionScheduleId || '').trim() || row.id
|
||||
const list = map.get(key)
|
||||
if (list) list.push(row)
|
||||
else map.set(key, [row])
|
||||
}
|
||||
return Array.from(map.entries()).map(([groupKey, workOrders]) => {
|
||||
const sorted = sortWorkOrdersInGroup(workOrders)
|
||||
const head = sorted[0]
|
||||
const groupTitle = (head?.applicationNo || head?.workOrderNo || groupKey).trim()
|
||||
return {
|
||||
groupKey,
|
||||
sampleCode: groupTitle,
|
||||
groupTitle,
|
||||
workOrders: sorted
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function triggerSourceTabLabel(row: QcWorkOrder) {
|
||||
return row.triggerSourceLabel || ((row.triggerSource || 'reception') === 'production' ? '生产过程' : '样本接收')
|
||||
if (row.triggerSourceLabel) return row.triggerSourceLabel
|
||||
const ts = row.triggerSource || 'reception'
|
||||
if (ts === 'production') return '生产过程'
|
||||
if (ts === 'schedule') return '计划质检'
|
||||
return '样本接收'
|
||||
}
|
||||
|
||||
export function isGateTriggerSource(source?: string | null) {
|
||||
const ts = (source || 'reception').trim()
|
||||
return ts === 'reception' || ts === 'schedule'
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export type QcWorkOrderTabConfig = {
|
||||
workOrderType: 'inbound' | 'outbound' | 'temporary'
|
||||
receptionSource?: 'cell_storage' | 'research_donation'
|
||||
bizType?: 'pilot_service' | 'basic_experiment' | 'clinical_application'
|
||||
listLayout: 'inbound-grouped' | 'standalone'
|
||||
listLayout: 'inbound-grouped' | 'outbound-grouped' | 'standalone'
|
||||
/** 侧栏 Tab 不展示(保留 key 供路由/数据解析) */
|
||||
hidden?: boolean
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export const QC_WORK_ORDER_TABS: QcWorkOrderTabConfig[] = [
|
||||
group: 'outbound',
|
||||
workOrderType: 'outbound',
|
||||
bizType: 'pilot_service',
|
||||
listLayout: 'standalone'
|
||||
listLayout: 'outbound-grouped'
|
||||
},
|
||||
{
|
||||
key: 'outbound_basic_experiment',
|
||||
@@ -53,7 +53,7 @@ export const QC_WORK_ORDER_TABS: QcWorkOrderTabConfig[] = [
|
||||
group: 'outbound',
|
||||
workOrderType: 'outbound',
|
||||
bizType: 'basic_experiment',
|
||||
listLayout: 'standalone'
|
||||
listLayout: 'outbound-grouped'
|
||||
},
|
||||
{
|
||||
key: 'outbound_clinical_application',
|
||||
@@ -140,10 +140,10 @@ export function filterTimeLabelForTab(tab: QcWorkOrderTabConfig): string {
|
||||
export function filterTimeHintForTab(tab: QcWorkOrderTabConfig): string {
|
||||
if (tab.group === 'outbound') {
|
||||
return tab.key === 'outbound_basic_experiment'
|
||||
? '默认展示近 30 天内交付的工单。'
|
||||
: '默认展示近 30 天内输注的工单。'
|
||||
? '支持按交付时间筛选。'
|
||||
: '支持按输注时间筛选。'
|
||||
}
|
||||
return '默认展示近 30 天内创建的工单。'
|
||||
return '支持按创建时间筛选。'
|
||||
}
|
||||
|
||||
export function workOrderMatchesTab(row: QcWorkOrder, tabKey: QcWorkOrderTabKey): boolean {
|
||||
|
||||
Reference in new issue
Block a user