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
@@ -82,6 +82,11 @@
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="样本状态" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.voidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="市场专员" min-width="110" align="center">
|
||||
<template #default="{ row }">{{ row.salesUserName || '—' }}</template>
|
||||
</el-table-column>
|
||||
@@ -265,6 +270,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Search, RefreshLeft, Document, Close } from '@element-plus/icons-vue'
|
||||
import ProtocolViewDialog from '../protocol/ProtocolViewDialog.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import ProtocolAttachmentReadonly from '../protocol/ProtocolAttachmentReadonly.vue'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
|
||||
@@ -90,6 +90,11 @@
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="样本状态" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.voidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签署日期" min-width="110" align="center">
|
||||
<template #default="{ row }">{{ row.signDate || '—' }}</template>
|
||||
</el-table-column>
|
||||
@@ -295,6 +300,7 @@
|
||||
import ProtocolViewDialog from '../protocol/ProtocolViewDialog.vue'
|
||||
import ProtocolAttachmentReadonly from '../protocol/ProtocolAttachmentReadonly.vue'
|
||||
import SamplePaymentDetailDialog from '@/components/business/sample-payment-detail-dialog/index.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import { fetchSamplePaymentList, fetchSamplePaymentDetail } from '@/api/protocol-sample-payment'
|
||||
import { type CollectionProtocolRow } from '@/api/collection-protocol'
|
||||
|
||||
@@ -175,6 +175,11 @@
|
||||
<span class="mono">{{ row.labStorageCode || '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="样本状态" min-width="140" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.sampleVoidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="协议状态" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="donationStatusTagType(row.donationStatus)" size="small">
|
||||
@@ -415,6 +420,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ProjectSelect from '@/components/business/ProjectSelect.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
const projectFilter = ref('')
|
||||
const teamFilter = ref('')
|
||||
import { formatDisplayOrDash } from '@/utils/datetime-display'
|
||||
|
||||
@@ -197,6 +197,11 @@
|
||||
<span class="mono">{{ row.sampleCode || '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="样本状态" min-width="140" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.sampleVoidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sampleTypeName"
|
||||
label="样本类型"
|
||||
@@ -383,6 +388,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ProjectSelect from '@/components/business/ProjectSelect.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
const projectFilter = ref('')
|
||||
const teamFilter = ref('')
|
||||
import { formatDisplayOrDash } from '@/utils/datetime-display'
|
||||
|
||||
@@ -206,6 +206,11 @@
|
||||
<span class="cell-wrap-text">{{ row.sampleCode || '—' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="样本状态" min-width="140" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.voidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sampleTypeName"
|
||||
label="样本类型"
|
||||
@@ -320,6 +325,7 @@
|
||||
sampleFreightSpanMethod,
|
||||
type SampleFreightFlatRow
|
||||
} from '@/utils/sample-freight-flatten'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import FreightConfigDialog from './FreightConfigDialog.vue'
|
||||
import FreightEditDialog from './FreightEditDialog.vue'
|
||||
|
||||
|
||||
@@ -207,6 +207,11 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="样本状态" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.voidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="motherName" label="母亲姓名" min-width="100" align="center" />
|
||||
<el-table-column prop="motherPhone" label="母亲电话" min-width="120" align="center">
|
||||
<template #default="{ row }">{{ row.motherPhone || '—' }}</template>
|
||||
@@ -368,6 +373,11 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="样本状态" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag :status="row.sampleStatus" :void-desc="row.voidDesc" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="labStorageCode" label="实验室入库编码" min-width="150" align="center">
|
||||
<template #default="{ row }">{{ row.labStorageCode || '—' }}</template>
|
||||
</el-table-column>
|
||||
@@ -503,6 +513,7 @@
|
||||
import ProtocolViewDialog from '@/views/cell-storage/protocol/ProtocolViewDialog.vue'
|
||||
import DonationViewDialog from '@/views/research-donation/list/DonationViewDialog.vue'
|
||||
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import SampleInfoQuickRegisterDialog from './SampleInfoQuickRegisterDialog.vue'
|
||||
import SampleCodeCorrectionDialog from './SampleCodeCorrectionDialog.vue'
|
||||
import {
|
||||
|
||||
+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,
|
||||
|
||||
@@ -93,9 +93,16 @@
|
||||
:min-width="col.minWidth || 120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
:show-overflow-tooltip="col.prop !== 'sampleStatus'"
|
||||
>
|
||||
<template #default="{ row }">{{ displayCell(row[col.prop]) }}</template>
|
||||
<template #default="{ row }">
|
||||
<SampleStatusTag
|
||||
v-if="col.prop === 'sampleStatus'"
|
||||
:status="String(row.sampleStatus || '')"
|
||||
:void-desc="String(row.voidDesc || '')"
|
||||
/>
|
||||
<template v-else>{{ displayCell(row[col.prop]) }}</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
@@ -178,11 +185,13 @@
|
||||
saveLabSampleProcessSupplement,
|
||||
type LabSampleProcessTabKey
|
||||
} from '@/api/lab-sample-process'
|
||||
import SampleStatusTag from '@/components/business/sample-status-tag/index.vue'
|
||||
import {
|
||||
LAB_PROCESS_COLUMNS,
|
||||
LAB_PROCESS_TABS,
|
||||
SUPPLEMENT_FIELD_LABELS
|
||||
} from '@/utils/lab-sample-process-columns'
|
||||
import { sampleStatusLabel } from '@/utils/status-tag-registry'
|
||||
|
||||
defineOptions({ name: 'QualityInspectionLabSampleProcess' })
|
||||
|
||||
@@ -274,9 +283,9 @@
|
||||
supplementForm.receptionSource = meta.source
|
||||
supplementForm.sampleTypeName = meta.sampleTypeName
|
||||
supplementForm.remark = ''
|
||||
const keys = supplementKeys.value.length
|
||||
? supplementKeys.value
|
||||
: currentColumns.value.map((c) => c.prop)
|
||||
const keys = (
|
||||
supplementKeys.value.length ? supplementKeys.value : currentColumns.value.map((c) => c.prop)
|
||||
).filter((k) => k !== 'sampleStatus' && k !== 'voidDesc')
|
||||
const payload: Record<string, string> = {}
|
||||
keys.forEach((k) => {
|
||||
payload[k] = ''
|
||||
@@ -324,6 +333,10 @@
|
||||
}
|
||||
cols.forEach((c) => {
|
||||
const v = row[c.prop]
|
||||
if (c.prop === 'sampleStatus') {
|
||||
line[c.label] = v ? sampleStatusLabel(String(v)) : ''
|
||||
return
|
||||
}
|
||||
line[c.label] = v === null || v === undefined || v === '' ? '' : String(v)
|
||||
})
|
||||
return line
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
<QcWorkOrderSampleGroup
|
||||
v-for="ins in insertedCardsAfter(allTabInboundAnchorId(item.group))"
|
||||
@@ -49,6 +50,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
</template>
|
||||
<QcWorkOrderSingleCard
|
||||
@@ -69,6 +71,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
@@ -96,6 +99,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
<QcWorkOrderSampleGroup
|
||||
v-for="ins in insertedCardsAfter(item.cardAnchorId)"
|
||||
@@ -120,6 +124,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
@@ -141,6 +146,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
@@ -163,6 +169,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
</template>
|
||||
<el-empty
|
||||
@@ -252,6 +259,7 @@
|
||||
command: [cmd: string, row: QcWorkOrder]
|
||||
'tasks-changed': []
|
||||
'sample-special-changed': []
|
||||
'sample-voided': []
|
||||
'page-change': [page: number]
|
||||
'page-size-change': [size: number]
|
||||
'sibling-navigate': [payload: InboundSiblingNavigatePayload]
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
|
||||
<SampleSpecialMarkDialog
|
||||
@@ -181,6 +182,7 @@
|
||||
command: [cmd: string, row: QcWorkOrder]
|
||||
'tasks-changed': []
|
||||
'sample-special-changed': []
|
||||
'sample-voided': []
|
||||
}>()
|
||||
|
||||
const sampleSpecialDialogVisible = ref(false)
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
@command="(cmd, row) => emit('command', cmd, row)"
|
||||
@tasks-changed="emit('tasks-changed')"
|
||||
@sample-special-changed="emit('sample-special-changed')"
|
||||
@sample-voided="emit('sample-voided')"
|
||||
/>
|
||||
|
||||
<SampleSpecialMarkDialog
|
||||
@@ -201,6 +202,7 @@
|
||||
command: [cmd: string, row: QcWorkOrder]
|
||||
'tasks-changed': []
|
||||
'sample-special-changed': []
|
||||
'sample-voided': []
|
||||
'sibling-navigate': [payload: InboundSiblingNavigatePayload]
|
||||
}>()
|
||||
|
||||
|
||||
@@ -64,8 +64,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"
|
||||
>
|
||||
@@ -162,6 +167,13 @@
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>特殊样本
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showSampleVoidButton"
|
||||
class="btn-op-item"
|
||||
@click="openSampleVoidDialog"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>样本废弃
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showStorageCertQcButton"
|
||||
class="btn-op-item"
|
||||
@@ -190,6 +202,13 @@
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>特殊样本
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showSampleVoidButton"
|
||||
class="btn-op-item"
|
||||
@click="openSampleVoidDialog"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>样本废弃
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showStorageCertQcButton"
|
||||
class="btn-op-item"
|
||||
@@ -254,6 +273,11 @@
|
||||
:target="sampleSpecialMarkTarget"
|
||||
@success="emit('sample-special-changed')"
|
||||
/>
|
||||
<SampleVoidDialog
|
||||
v-model:visible="sampleVoidDialogVisible"
|
||||
:target="sampleVoidTarget"
|
||||
@success="emit('sample-voided')"
|
||||
/>
|
||||
<StorageCertQcDialog
|
||||
v-model:visible="storageCertQcVisible"
|
||||
mode="edit"
|
||||
@@ -302,7 +326,11 @@
|
||||
import QcWorkOrderProtocolPaymentPanel from './QcWorkOrderProtocolPaymentPanel.vue'
|
||||
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
|
||||
import SampleSpecialMarkDialog from '@/components/business/sample-special-mark-dialog/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 { resolveInboundSampleSpecialMarkTargetFromRow } from '@/utils/inbound-sample-special-mark'
|
||||
import { isSampleAlreadyVoided, resolveSampleVoidTarget } from '@/utils/sample-void'
|
||||
import QcWorkOrderSelectCheckbox from './QcWorkOrderSelectCheckbox.vue'
|
||||
|
||||
defineOptions({ name: 'QcWorkOrderSingleCard' })
|
||||
@@ -340,9 +368,12 @@
|
||||
command: [cmd: string, row: QcWorkOrder]
|
||||
'tasks-changed': []
|
||||
'sample-special-changed': []
|
||||
'sample-voided': []
|
||||
}>()
|
||||
|
||||
const sampleSpecialDialogVisible = ref(false)
|
||||
const sampleVoidDialogVisible = ref(false)
|
||||
const sampleVoidTarget = ref<SampleVoidTarget | null>(null)
|
||||
const storageCertQcVisible = ref(false)
|
||||
|
||||
const showStorageCertQcButton = computed(() => {
|
||||
@@ -377,6 +408,32 @@
|
||||
resolveEffectiveRowTabKey(props.cardMetaConfig.tabKey, props.row)
|
||||
)
|
||||
|
||||
function inboundVoidFallbackSource() {
|
||||
if (effectiveRowTabKey.value === 'inbound_research_donation') return 'research_donation'
|
||||
if (effectiveRowTabKey.value === 'inbound_cell_storage') return 'cell_storage'
|
||||
return ''
|
||||
}
|
||||
|
||||
const sampleVoidResolved = computed(() =>
|
||||
resolveSampleVoidTarget({
|
||||
receptionSource: props.row.receptionSource,
|
||||
protocolSampleId: props.row.protocolSampleId,
|
||||
sampleCode: props.row.sampleCode,
|
||||
collectionProtocolId: props.row.collectionProtocolId,
|
||||
fallbackSource: inboundVoidFallbackSource()
|
||||
})
|
||||
)
|
||||
|
||||
const showSampleVoidButton = computed(
|
||||
() => !!sampleVoidResolved.value && !isSampleAlreadyVoided(props.row.sampleStatus)
|
||||
)
|
||||
|
||||
function openSampleVoidDialog() {
|
||||
if (!sampleVoidResolved.value) return
|
||||
sampleVoidTarget.value = sampleVoidResolved.value
|
||||
sampleVoidDialogVisible.value = true
|
||||
}
|
||||
|
||||
const visibleMetaFields = computed(() =>
|
||||
effectiveCardMeta.value.metaFields.filter((field) => !field.visible || field.visible(props.row))
|
||||
)
|
||||
|
||||
@@ -362,6 +362,7 @@
|
||||
@command="handleCommand"
|
||||
@tasks-changed="onWorkOrderTasksChanged"
|
||||
@sample-special-changed="onSampleSpecialChanged"
|
||||
@sample-voided="onSampleVoided"
|
||||
@page-change="handleWorkOrderPageChange"
|
||||
@page-size-change="handleWorkOrderPageSizeChange"
|
||||
/>
|
||||
@@ -560,6 +561,11 @@
|
||||
emit('data-changed')
|
||||
}
|
||||
|
||||
async function onSampleVoided() {
|
||||
await loadData()
|
||||
emit('data-changed')
|
||||
}
|
||||
|
||||
function handleCommand(command: string, row: QcWorkOrder) {
|
||||
if (command === 'view') {
|
||||
handleView(row)
|
||||
|
||||
Reference in new issue
Block a user