feat(sample): 展示样本状态并支持样本废弃与作废原因
生产/质检入库卡片展示样本状态并支持【样本废弃】;市场 Web 列表与移动市场部卡片补充样本状态及问号查看作废原因;样本表新增 void_desc,人工作废不联动接收但全部作废时自动作废协议(#131)。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7751cc0f4a
commit
0b4c8dfda8
53 files changed
+1527
-82
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import type { SampleVoidTarget } from '../api/business-sample'
|
||||
|
||||
export function isSampleAlreadyVoided(status?: string | null): boolean {
|
||||
return String(status || '').trim() === 'yzf'
|
||||
}
|
||||
|
||||
export function resolveSampleVoidTarget(input: {
|
||||
receptionSource?: string | null
|
||||
protocolSampleId?: string | null
|
||||
sampleCode?: string | null
|
||||
collectionProtocolId?: string | null
|
||||
fallbackSource?: string | null
|
||||
}): SampleVoidTarget | null {
|
||||
let source = String(input.receptionSource || '').trim()
|
||||
if (source !== 'cell_storage' && source !== 'research_donation') {
|
||||
source = String(input.fallbackSource || '').trim()
|
||||
}
|
||||
if (source !== 'cell_storage' && source !== 'research_donation') return null
|
||||
const sampleId = String(input.protocolSampleId || '').trim()
|
||||
const sampleCode = String(input.sampleCode || '').trim()
|
||||
const protocolId = String(input.collectionProtocolId || '').trim()
|
||||
if (!sampleId && !sampleCode) return null
|
||||
return {
|
||||
receptionSource: source,
|
||||
sampleId: sampleId || undefined,
|
||||
sampleCode: sampleCode || undefined,
|
||||
protocolId: protocolId || undefined
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user