fix(sample): 样本状态问号仅已作废时展示 (#134) #135

Merged
cykj merged 1 commits from codex/issue-134-void-status-q-only-3186179f2b0d into V2.0 2026-11-19 06:30:49 +00:00
2 changed files with 10 additions and 8 deletions

No files matched your search

@@ -270,12 +270,12 @@ test('sample-coded list cards show sample status and a void reason affordance',
}).fields.find((field) => field.label === '样本状态').value,
'已入库'
)
assert.equal(
buildMarketCard('payment-chase', 'specialist', {
sampleCode: 'S-1', sampleStatus: 'jcz'
}).fields.find((field) => field.label === '样本状态').value,
'检测中'
)
const detecting = buildMarketCard('payment-chase', 'specialist', {
sampleCode: 'S-1', sampleStatus: 'jcz'
}).fields.find((field) => field.label === '样本状态')
assert.equal(detecting.value, '检测中')
assert.equal(detecting.helpTitle, undefined)
assert.equal(detecting.helpText, undefined)
const voided = buildMarketCard('payment', 'specialist', {
motherName: '作废客户',
@@ -1,8 +1,8 @@
<!-- 样本状态:标签 + 作废原因 -->
<!-- 样本状态:标签;仅已作废时展示问号与作废原因 -->
<template>
<span class="sample-status-tag">
<el-tag :type="tagType" size="small">{{ label }}</el-tag>
<el-popover placement="top" trigger="click" :width="240">
<el-popover v-if="voided" placement="top" trigger="click" :width="240">
<template #reference>
<button type="button" class="sample-status-tag__q" aria-label="作废原因" @click.stop>
<el-icon><QuestionFilled /></el-icon>
@@ -31,6 +31,8 @@
const code = computed(() => String(props.status || '').trim())
const label = computed(() => (code.value ? sampleStatusLabel(code.value) : '—'))
const tagType = computed(() => (code.value ? sampleStatusTagType(code.value) : 'info'))
/** 问号仅已作废(yzf)展示 */
const voided = computed(() => code.value === 'yzf')
const reasonText = computed(() => String(props.voidDesc || '').trim() || '暂无作废原因')
</script>