feat: show both release verdicts on protocol sample cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8280e4bc24
commit
e5128a087a
1 file changed
+96
-29
@@ -10,42 +10,70 @@
|
||||
<template v-else>
|
||||
<div class="storage-release-info-grid">
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">审核结论</span>
|
||||
<span class="qc-kv__label">生产结论</span>
|
||||
<span class="qc-kv__value">
|
||||
<el-tag
|
||||
v-if="storageReleaseInfo.reviewConclusion"
|
||||
:type="storageReleaseInfo.reviewConclusion === 'tg' ? 'success' : 'danger'"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
storageReleaseInfo.reviewConclusionLabel ||
|
||||
conclusionLabel(storageReleaseInfo.reviewConclusion)
|
||||
}}
|
||||
<el-tag :type="conclusionTagType(storageReleaseInfo.prodReviewConclusion)" size="small">
|
||||
{{ conclusionDisplay(storageReleaseInfo.prodReviewConclusion, storageReleaseInfo.prodReviewConclusionLabel) }}
|
||||
</el-tag>
|
||||
<span v-else class="qc-kv__muted">待审核</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">审核人</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.reviewByName || '—' }}</span>
|
||||
<span class="qc-kv__label">质检结论</span>
|
||||
<span class="qc-kv__value">
|
||||
<el-tag :type="conclusionTagType(storageReleaseInfo.qcReviewConclusion)" size="small">
|
||||
{{ conclusionDisplay(storageReleaseInfo.qcReviewConclusion, storageReleaseInfo.qcReviewConclusionLabel) }}
|
||||
</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">审核时间</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.reviewTime || '—' }}</span>
|
||||
<span class="qc-kv__label">入库状态</span>
|
||||
<span class="qc-kv__value">
|
||||
<el-tag
|
||||
:type="storageReleaseInfo.storageStatus === 'yrk' ? 'success' : 'info'"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
storageReleaseInfo.storageStatusLabel ||
|
||||
storageStatusLabel(storageReleaseInfo.storageStatus)
|
||||
}}
|
||||
</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="storageReleaseInfo.reviewRemark" class="qc-kv qc-kv--full">
|
||||
<span class="qc-kv__label">审核备注</span>
|
||||
<span class="qc-kv__value qc-kv__value--muted">{{
|
||||
storageReleaseInfo.reviewRemark
|
||||
}}</span>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">生产审核人</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.prodReviewByName || '—' }}</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">生产审核时间</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.prodReviewTime || '—' }}</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">质检审核人</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.qcReviewByName || '—' }}</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">质检审核时间</span>
|
||||
<span class="qc-kv__value">{{ storageReleaseInfo.qcReviewTime || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="attachmentFiles.length" class="storage-release-attachments">
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">审核附件</span>
|
||||
<div v-if="qcAttachmentFiles.length" class="storage-release-attachments">
|
||||
<div class="qc-kv qc-kv--full">
|
||||
<span class="qc-kv__label">质检附件</span>
|
||||
<span class="qc-kv__value">
|
||||
<ProtocolAttachmentReadonly
|
||||
:files="attachmentFiles"
|
||||
:files="qcAttachmentFiles"
|
||||
@preview="handlePreview"
|
||||
@download="handleDownload"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="prodAttachmentFiles.length" class="storage-release-attachments">
|
||||
<div class="qc-kv qc-kv--full">
|
||||
<span class="qc-kv__label">生产附件</span>
|
||||
<span class="qc-kv__value">
|
||||
<ProtocolAttachmentReadonly
|
||||
:files="prodAttachmentFiles"
|
||||
@preview="handlePreview"
|
||||
@download="handleDownload"
|
||||
/>
|
||||
@@ -67,6 +95,20 @@
|
||||
reviewTime?: string
|
||||
reviewRemark?: string
|
||||
reviewAttachments?: string
|
||||
qcReviewConclusion?: string
|
||||
qcReviewConclusionLabel?: string
|
||||
qcReviewByName?: string
|
||||
qcReviewTime?: string
|
||||
qcReviewRemark?: string
|
||||
qcReviewAttachments?: string
|
||||
prodReviewConclusion?: string
|
||||
prodReviewConclusionLabel?: string
|
||||
prodReviewByName?: string
|
||||
prodReviewTime?: string
|
||||
prodReviewRemark?: string
|
||||
prodReviewAttachments?: string
|
||||
storageStatus?: string
|
||||
storageStatusLabel?: string
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -75,19 +117,26 @@
|
||||
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
const attachmentFiles = computed(() => {
|
||||
const urls = String(props.storageReleaseInfo?.reviewAttachments || '').trim()
|
||||
function splitAttachmentUrls(raw?: string, prefix = 'srr') {
|
||||
const urls = String(raw || '').trim()
|
||||
if (!urls) return []
|
||||
return urls
|
||||
.split(',')
|
||||
.map((u) => u.trim())
|
||||
.filter(Boolean)
|
||||
.map((fileUrl, i) => ({
|
||||
id: `srr_${i}`,
|
||||
id: `${prefix}_${i}`,
|
||||
fileUrl,
|
||||
fileName: fileUrl.split('/').pop() || `附件${i + 1}`
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const qcAttachmentFiles = computed(() =>
|
||||
splitAttachmentUrls(props.storageReleaseInfo?.qcReviewAttachments, 'srr_qc')
|
||||
)
|
||||
const prodAttachmentFiles = computed(() =>
|
||||
splitAttachmentUrls(props.storageReleaseInfo?.prodReviewAttachments, 'srr_prod')
|
||||
)
|
||||
|
||||
function conclusionLabel(conclusion: string) {
|
||||
if (conclusion === 'tg') return '通过'
|
||||
@@ -95,6 +144,24 @@
|
||||
return conclusion
|
||||
}
|
||||
|
||||
function conclusionDisplay(code?: string, label?: string) {
|
||||
const v = String(code || '').trim()
|
||||
if (!v) return '待审核'
|
||||
return label || conclusionLabel(v)
|
||||
}
|
||||
|
||||
function conclusionTagType(code?: string): 'success' | 'danger' | 'info' {
|
||||
const v = String(code || '').trim()
|
||||
if (v === 'tg') return 'success'
|
||||
if (v === 'btg') return 'danger'
|
||||
return 'info'
|
||||
}
|
||||
|
||||
function storageStatusLabel(status?: string) {
|
||||
if (status === 'yrk') return '已入库'
|
||||
return '待入库'
|
||||
}
|
||||
|
||||
function fullFileUrl(suffix: string) {
|
||||
if (!suffix) return ''
|
||||
if (suffix.startsWith('http://') || suffix.startsWith('https://') || suffix.startsWith('/'))
|
||||
@@ -161,7 +228,7 @@
|
||||
.qc-kv__label {
|
||||
color: var(--mint-text-muted, #334155);
|
||||
flex-shrink: 0;
|
||||
min-width: 56px;
|
||||
min-width: 84px;
|
||||
}
|
||||
|
||||
.qc-kv__value {
|
||||
|
||||
Reference in new issue
Block a user