This commit is contained in:
zlwu committed 2026-05-26 21:27:48 +08:00
1 parent edf88dc016
commit 3f122da803
55 files changed
+13486 -8504

No files matched your search

@@ -47,9 +47,7 @@
</el-form-item>
</div>
<div class="filter-actions-row">
<span class="filter-hint"
>默认展示近 30 天内已开始的任务;清空日期可查看尚未开始的待配置任务。</span
>
<span class="filter-hint">可按任务开始时间筛选;不选日期则展示全部任务。</span>
<div class="filter-actions-end">
<el-button class="btn-ghost" @click="handleReset"
><el-icon><RefreshLeft /></el-icon>重置</el-button
@@ -81,8 +79,8 @@
<el-table-column prop="workOrderNo" label="所属工单号" min-width="140" align="center" />
<el-table-column prop="orderSource" label="来源" min-width="100" align="center">
<template #default="{ row }">
<el-tag :type="row.orderSource === 'temporary' ? 'warning' : 'success'" size="small">
{{ row.orderSource === 'temporary' ? '临时' : '入库' }}
<el-tag :type="productionOrderSourceTag(row.orderSource).type" size="small">
{{ productionOrderSourceTag(row.orderSource).label }}
</el-tag>
</template>
</el-table-column>
@@ -118,9 +116,9 @@
</el-table-column>
<el-table-column prop="taskType" label="任务类型" min-width="120" align="center">
<template #default="{ row }">
<el-tag :type="taskTypeTag(row.taskType, row.orderSource).type" size="small">{{
taskTypeTag(row.taskType, row.orderSource).label
}}</el-tag>
<el-tag :type="productionTaskTypeTag(row.taskType, row.orderSource).type" size="small">
{{ productionTaskTypeTag(row.taskType, row.orderSource).label }}
</el-tag>
</template>
</el-table-column>
<el-table-column
@@ -325,7 +323,12 @@
import TaskExecutionDialog from '../production-work-order/TaskExecutionDialog.vue'
import DispatchTaskDialog from '../production-work-order/DispatchTaskDialog.vue'
import EditTaskInfoDialog from '../production-work-order/EditTaskInfoDialog.vue'
import { productionConclusionLabel, productionConclusionTagType } from '@/utils/production-labels'
import {
productionConclusionLabel,
productionConclusionTagType,
productionOrderSourceTag,
productionTaskTypeTag
} from '@/utils/production-labels'
/** 根据来源类型返回协议状态标签 */
function protocolStatusLabelBySource(status: string, source: string): string {
@@ -407,36 +410,11 @@
return map[status] || { label: status, type: 'info' }
}
function taskTypeTag(taskType: string, orderSource?: string) {
if (orderSource === 'temporary') {
return { label: '临时生产单', type: 'warning' }
}
const map: Record<string, { label: string; type: string }> = {
cell_storage: { label: '入库生产单', type: 'primary' },
outbound: { label: '出库生产单', type: 'warning' }
}
return map[taskType] || { label: taskType, type: 'info' }
}
// ---------------------------------------------------------------------------
// 列表视图
// ---------------------------------------------------------------------------
function formatLocalDate(d: Date): string {
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
}
function getDefaultLast30DaysRange(): [string, string] {
const end = new Date()
const start = new Date()
start.setDate(start.getDate() - 30)
return [formatLocalDate(start), formatLocalDate(end)]
}
const searchForm = reactive({ keyword: '', taskStatus: '' })
const startedTimeRange = ref<[string, string] | null>(getDefaultLast30DaysRange())
const startedTimeRange = ref<[string, string] | null>(null)
const tableData = ref<Record<string, any>[]>([])
const loading = ref(false)
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
@@ -474,7 +452,7 @@
function handleReset() {
searchForm.keyword = ''
searchForm.taskStatus = ''
startedTimeRange.value = getDefaultLast30DaysRange()
startedTimeRange.value = null
pagination.page = 1
loadData()
}
@@ -199,6 +199,7 @@
import { Rank, Plus, CopyDocument, Delete } from '@element-plus/icons-vue'
import { VueDraggable as draggable } from 'vue-draggable-plus'
import { fetchCreateProductionTask } from '@/api/production-task'
import { productionTaskTypeForWorkOrder } from '@/utils/production-labels'
import { fetchProcessRouteList } from '@/api/production'
import type { FormInstance, FormRules } from 'element-plus'
import { useTaskStepEditor } from './useTaskStepEditor'
@@ -264,7 +265,7 @@
try {
const task = await fetchCreateProductionTask({
work_order_id: props.workOrderRow.id,
task_type: 'cell_storage',
task_type: productionTaskTypeForWorkOrder(props.workOrderRow.workOrderType),
task_name: form.taskName,
route_id: form.routeId,
description: form.description || undefined,
@@ -145,24 +145,6 @@
>
<template #default="{ row }">{{ row.applicationNo || '—' }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
prop="cellType"
label="细胞类型"
min-width="110"
align="center"
>
<template #default="{ row }">{{ row.cellType || '—' }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
prop="specText"
label="规格"
min-width="110"
align="center"
>
<template #default="{ row }">{{ row.specText || '—' }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
prop="infusionTime"
@@ -332,10 +314,72 @@
<SystemViewDialog
v-model:visible="viewVisible"
title="工单详情"
:width="viewDialogWidth"
:grid-columns="viewDialogGridColumns"
:compact="viewDialogCompact"
:icon="Document"
:meta="detail?.workOrderNo || ''"
:sections="viewSections"
>
<template #diagnosis-attachments>
<ProtocolAttachmentReadonly
:files="viewDiagnosisAttachmentFiles"
@preview="handleReceptionAttachmentPreview"
@download="handleReceptionAttachmentDownload"
/>
</template>
<template #product-table>
<div v-if="detail?.products?.length" class="view-subtable-wrap">
<el-table
:data="detail?.products || []"
stripe
size="small"
class="list-table view-subtable"
>
<el-table-column type="index" label="序号" min-width="60" align="center" />
<el-table-column
prop="projectCode"
label="项目编码"
min-width="120"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="projectName"
label="项目名称"
min-width="120"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="cellTypeName"
label="细胞类型"
min-width="100"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="specText"
label="规格"
min-width="100"
align="center"
show-overflow-tooltip
/>
<el-table-column prop="quantity" label="数量" min-width="70" align="center" />
<el-table-column label="产品状态" min-width="100" align="center">
<template #default="{ row }">
<el-tag
:type="productStatusTagType(row.productStatus || '') as any"
size="small"
>
{{ productStatusLabel(row.productStatus || '') }}
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
<p v-else class="view-empty-hint">暂无产品明细</p>
</template>
<template #reception-extra>
<div class="view-reception-attachments">
<div class="view-kv view-kv-span-2">
@@ -548,8 +592,12 @@
protocolStatusLabel,
protocolStatusTagType,
donationStatusLabel,
donationStatusTagType
donationStatusTagType,
productStatusLabel,
productStatusTagType
} from '@/utils/status-tag-registry'
import { buildOutboundPilotContextSections } from '@/utils/outbound-qc-pilot-view-sections'
import type { OutboundQcDetail } from '@/api/qc-work-order'
import type { TagType } from '@/utils/status-tag-registry'
/** 根据来源类型返回协议状态标签 */
@@ -767,6 +815,15 @@
const viewVisible = ref(false)
const detail = ref<ProductionWorkOrderDetail | null>(null)
const isOutboundPilotService = computed(
() =>
detail.value?.workOrderType === 'outbound' && detail.value?.bizType === 'pilot_service'
)
const viewDialogWidth = computed(() => (isOutboundPilotService.value ? '1200px' : '720px'))
const viewDialogGridColumns = computed<2 | 3 | 4>(() =>
isOutboundPilotService.value ? 4 : 2
)
const viewDialogCompact = computed(() => isOutboundPilotService.value)
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
const viewReceptionAttachmentFiles = computed(() => {
@@ -799,6 +856,21 @@
function handleReceptionAttachmentDownload(file: Record<string, unknown>) {
downloadAttachmentFile(file, { fullFileUrl: receptionAttachmentFullUrl })
}
const viewDiagnosisAttachmentFiles = computed(() => {
const urls = detail.value?.patient?.diagnosisAttachments || ''
if (!urls.trim()) return []
return urls
.split(',')
.map((u, i) => {
const url = u.trim()
if (!url) return null
const name = url.includes('/') ? url.split('/').pop() || `附件${i + 1}` : url
return { id: `url_${i}`, fileUrl: receptionAttachmentFullUrl(url), fileName: name }
})
.filter(Boolean) as Array<Record<string, unknown>>
})
function formatMetric(v: unknown) {
if (v === null || v === undefined || v === '') return '—'
return String(v)
@@ -880,50 +952,62 @@
const sections: ViewSection[] = [{ title: '基本信息', fields: baseFields }]
// outbound: 申请单 + 输注计划
// outbound: 中试服务 — 与出库质检工单查看弹窗一致;临床应用 — 保留简要申请/输注信息
if (isOutbound) {
const pa = d.pilotApplication || {}
const sched = d.infusionSchedule || {}
const appStatusLabel = (s: string) => {
const m: Record<string, string> = {
dks: '待开始',
jxz: '进行中',
ywc: '已完成',
yzf: '已作废'
if (d.bizType === 'pilot_service') {
const pilotDetail: OutboundQcDetail = {
workOrder: {} as OutboundQcDetail['workOrder'],
application: d.application,
patient: d.patient,
infusionPlan: d.infusionPlan,
infusionSchedule: d.infusionSchedule,
products: d.products
}
return m[s] || s || '—'
}
const appStatusTagType = (s: string) => {
const m: Record<string, string> = {
dks: 'info',
jxz: 'warning',
ywc: 'success',
yzf: 'danger'
}
return m[s] || 'info'
}
sections.push({
title: '中试申请信息',
fields: [
{ label: '申请单号', value: pa.applicationNo || '—' },
{ label: '申请名称', value: pa.applicationName || '—' },
{
label: '申请状态',
value: appStatusLabel(pa.applicationStatus),
tagType: appStatusTagType(pa.applicationStatus) as any
sections.push(...buildOutboundPilotContextSections(pilotDetail))
} else {
const pa = d.pilotApplication || {}
const sched = d.infusionSchedule || {}
const appStatusLabel = (s: string) => {
const m: Record<string, string> = {
dks: '待开始',
jxz: '进行中',
ywc: '已完成',
yzf: '已作废'
}
]
})
sections.push({
title: '输注计划信息',
fields: [
{ label: '细胞类型', value: sched.cellType || '—' },
{ label: '规格', value: sched.specText || '—' },
{ label: '输注时间', value: sched.infusionTime || '—' },
{ label: '输注地点', value: sched.infusionLocation || '—' },
{ label: '输注方式', value: sched.infusionMethod || '—' }
]
})
return m[s] || s || '—'
}
const appStatusTagType = (s: string) => {
const m: Record<string, string> = {
dks: 'info',
jxz: 'warning',
ywc: 'success',
yzf: 'danger'
}
return m[s] || 'info'
}
sections.push({
title: '中试申请信息',
fields: [
{ label: '申请单号', value: pa.applicationNo || '—' },
{ label: '申请名称', value: pa.applicationName || '—' },
{
label: '申请状态',
value: appStatusLabel(pa.applicationStatus || ''),
tagType: appStatusTagType(pa.applicationStatus || '') as any
}
]
})
sections.push({
title: '输注计划信息',
fields: [
{ label: '细胞类型', value: sched.cellType || '—' },
{ label: '规格', value: sched.specText || '—' },
{ label: '输注时间', value: sched.infusionTime || '—' },
{ label: '输注地点', value: sched.infusionLocation || '—' },
{ label: '输注方式', value: sched.infusionMethod || '—' }
]
})
}
return sections
}