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
+56
-1
@@ -105,6 +105,13 @@
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>样本接收信息填写
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showSampleVoidButton(row)"
|
||||
class="btn-op-item"
|
||||
@click="openSampleVoidDialog(row)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>样本废弃
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showCardComplete(row) && canComplete(row)"
|
||||
class="btn-op-item"
|
||||
@@ -169,8 +176,13 @@
|
||||
>
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>
|
||||
<SampleStatusTag
|
||||
v-if="field.kind === 'sample-status'"
|
||||
:status="row.sampleStatus"
|
||||
:void-desc="row.voidDesc"
|
||||
/>
|
||||
<el-tag
|
||||
v-if="field.kind === 'tag'"
|
||||
v-else-if="field.kind === 'tag'"
|
||||
:type="field.getTagType?.(row) || 'info'"
|
||||
size="small"
|
||||
:class="{
|
||||
@@ -319,6 +331,11 @@
|
||||
:sample-code="storageCertQcSampleCode"
|
||||
:sample-type-name="storageCertQcSampleTypeName"
|
||||
/>
|
||||
<SampleVoidDialog
|
||||
v-model:visible="sampleVoidVisible"
|
||||
:target="sampleVoidTarget"
|
||||
@success="emit('sample-voided')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -342,7 +359,11 @@
|
||||
import type { OutboundQcDetailProduct } from '@/api/qc-work-order'
|
||||
import type { ProductionWorkOrderCardMetaConfig } from '@/utils/production-work-order-card-meta'
|
||||
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import SampleVoidDialog from '@/components/business/sample-void-dialog/index.vue'
|
||||
import type { SampleVoidTarget } from '@/api/business-sample'
|
||||
import StorageCertQcDialog from '@/components/business/storage-cert-qc-dialog/index.vue'
|
||||
import { isSampleAlreadyVoided, resolveSampleVoidTarget } from '@/utils/sample-void'
|
||||
import { supportsStorageCertQc } from '@/utils/storage-cert-qc-fields'
|
||||
import {
|
||||
getCardMetaConfigForLegacyTab,
|
||||
@@ -411,6 +432,8 @@
|
||||
const storageCertQcVisible = ref(false)
|
||||
const storageCertQcSampleCode = ref('')
|
||||
const storageCertQcSampleTypeName = ref('')
|
||||
const sampleVoidVisible = ref(false)
|
||||
const sampleVoidTarget = ref<SampleVoidTarget | null>(null)
|
||||
|
||||
function showStorageCertQcButton(row: ProductionWorkOrderItem) {
|
||||
const tabKey = resolveEffectiveRowTabKey(listTabKey.value, row)
|
||||
@@ -463,6 +486,37 @@
|
||||
return INBOUND_SAMPLE_TITLE_TAB_KEYS.has(effectiveTabKey)
|
||||
}
|
||||
|
||||
function productionVoidFallbackSource(row: ProductionWorkOrderItem) {
|
||||
const tabKey = resolveEffectiveRowTabKey(listTabKey.value, row)
|
||||
if (tabKey === 'inbound_research_donation') return 'research_donation'
|
||||
if (tabKey === 'inbound_cell_storage') return 'cell_storage'
|
||||
return ''
|
||||
}
|
||||
|
||||
function showSampleVoidButton(row: ProductionWorkOrderItem) {
|
||||
if (!isInboundSampleTitle(row) || isSampleAlreadyVoided(row.sampleStatus)) return false
|
||||
return !!resolveSampleVoidTarget({
|
||||
receptionSource: row.receptionSource,
|
||||
protocolSampleId: row.protocolSampleId,
|
||||
sampleCode: row.sampleCode,
|
||||
collectionProtocolId: row.collectionProtocolId,
|
||||
fallbackSource: productionVoidFallbackSource(row)
|
||||
})
|
||||
}
|
||||
|
||||
function openSampleVoidDialog(row: ProductionWorkOrderItem) {
|
||||
const target = resolveSampleVoidTarget({
|
||||
receptionSource: row.receptionSource,
|
||||
protocolSampleId: row.protocolSampleId,
|
||||
sampleCode: row.sampleCode,
|
||||
collectionProtocolId: row.collectionProtocolId,
|
||||
fallbackSource: productionVoidFallbackSource(row)
|
||||
})
|
||||
if (!target) return
|
||||
sampleVoidTarget.value = target
|
||||
sampleVoidVisible.value = true
|
||||
}
|
||||
|
||||
function inboundCardTitleLab(row: ProductionWorkOrderItem) {
|
||||
return (row.labStorageCode || '').trim() || '—'
|
||||
}
|
||||
@@ -500,6 +554,7 @@
|
||||
'page-change': [page: number]
|
||||
'page-size-change': [size: number]
|
||||
'open-sample-reception': [row: ProductionWorkOrderItem]
|
||||
'sample-voided': []
|
||||
}>()
|
||||
|
||||
const showCardOpsRow = computed(() => true)
|
||||
|
||||
+6
@@ -198,6 +198,7 @@
|
||||
@tasks-changed="onTasksChanged"
|
||||
@counts-changed="onCountsChanged"
|
||||
@open-sample-reception="handleOpenSampleReception"
|
||||
@sample-voided="handleSampleVoided"
|
||||
@page-change="onWorkOrderPageChange"
|
||||
@page-size-change="onWorkOrderPageSizeChange"
|
||||
/>
|
||||
@@ -371,6 +372,11 @@
|
||||
emit('data-changed')
|
||||
}
|
||||
|
||||
function handleSampleVoided() {
|
||||
loadData()
|
||||
emit('data-changed')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
reload: loadData,
|
||||
bumpTaskRefresh,
|
||||
|
||||
Reference in new issue
Block a user