This commit is contained in:
zlwu committed 2026-06-16 15:17:32 +08:00
1 parent 4f24d3b687
commit 1ff73b9a74
202 files changed
+11989 -10045

No files matched your search

@@ -553,11 +553,112 @@
v-model:visible="viewVisible"
:title="viewRow?.productName || '产品详情'"
:icon="Box"
:meta="viewRow?.productCode || ''"
:code="viewRow?.productCode"
code-label="产品编码"
:sections="viewSections"
width="1200px"
:grid-columns="4"
:grid-columns="3"
>
<template #basicInfo>
<div v-if="viewRow" class="cell-product-basic">
<div class="cell-product-basic__content">
<div class="cell-product-basic__summary">
<div class="cell-product-basic__headline">
<span class="cell-product-basic__name">{{ viewCellVal(viewRow.productName) }}</span>
<el-tag
:type="productStatusTag(String(viewRow.productStatus || '')).type"
size="small"
>
{{ productStatusTag(String(viewRow.productStatus || '')).label }}
</el-tag>
</div>
<div class="cell-product-basic__meta">
<span>{{ viewCellVal(viewRow.productTypeName) }}</span>
<span class="cell-product-basic__meta-sep">·</span>
<span>{{ viewCellVal(viewRow.specName) }}</span>
</div>
</div>
<div class="cell-product-basic__panels">
<div class="cell-product-basic__panel">
<div class="cell-product-basic__panel-title">批次与存储</div>
<div class="cell-product-basic__grid">
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">代次</div>
<div class="cell-product-basic__field-value">{{ viewCellVal(viewRow.passage) }}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">批次号</div>
<div class="cell-product-basic__field-value">{{ viewCellVal(viewRow.batchNo) }}</div>
</div>
<div class="cell-product-basic__field cell-product-basic__field--wide">
<div class="cell-product-basic__field-label">储物格位置</div>
<div class="cell-product-basic__field-value">{{
viewCellVal(viewRow.storageSlotName)
}}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">冻存日期</div>
<div class="cell-product-basic__field-value">{{ viewCellVal(viewRow.freezeDate) }}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">有效期</div>
<div class="cell-product-basic__field-value">{{ viewCellVal(viewRow.expiryDate) }}</div>
</div>
</div>
</div>
<div class="cell-product-basic__panel">
<div class="cell-product-basic__panel-title">质量与数量</div>
<div class="cell-product-basic__grid">
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">预计细胞数量(亿)</div>
<div class="cell-product-basic__field-value">{{
viewRow.expectedCellCount != null ? String(viewRow.expectedCellCount) : '—'
}}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">活性(%)</div>
<div class="cell-product-basic__field-value">{{
viewRow.viability != null ? String(viewRow.viability) : '—'
}}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">数量</div>
<div class="cell-product-basic__field-value">{{
viewRow.quantity != null ? String(viewRow.quantity) : '—'
}}</div>
</div>
<div class="cell-product-basic__field">
<div class="cell-product-basic__field-label">单位</div>
<div class="cell-product-basic__field-value">{{ viewCellVal(viewRow.unit) }}</div>
</div>
</div>
</div>
</div>
<div v-if="viewRow.remark" class="cell-product-basic__panel cell-product-basic__panel--remark">
<div class="cell-product-basic__panel-title">备注</div>
<p class="cell-product-basic__remark">{{ viewRow.remark }}</p>
</div>
</div>
<aside v-if="viewRow.productCode" class="cell-product-basic__aside">
<div class="cell-product-qr-card">
<QrcodeVue
:value="String(viewRow.productCode)"
:size="120"
level="M"
render-as="svg"
foreground="#065f46"
background="#ffffff"
/>
<p class="cell-product-qr-card__label">扫码识别产品编码</p>
<p class="cell-product-qr-card__code">{{ viewRow.productCode }}</p>
</div>
</aside>
</div>
</template>
<template #images>
<div class="attachment-upload attachment-upload--readonly">
<div v-if="viewProductImageFiles.length" class="attachment-list">
@@ -617,6 +718,7 @@
} from '@element-plus/icons-vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import type { ViewSection } from '@/components/business/system-view-dialog/index.vue'
import QrcodeVue from 'qrcode.vue'
import SourceChainGraph from './SourceChainGraph.vue'
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
import {
@@ -676,6 +778,11 @@
return map[status] || { label: status, type: 'info' }
}
function viewCellVal(val: unknown): string {
if (val === null || val === undefined || val === '') return '—'
return String(val)
}
/* ---- 搜索 & 分页 ---- */
const searchForm = reactive({ keyword: '', productStatus: '', passage: '', sourceType: '' })
const tableData = ref<any[]>([])
@@ -886,43 +993,11 @@
/* ---- 查看弹窗 sections ---- */
const viewSections = computed((): ViewSection[] => {
if (!viewRow.value) return []
const row = viewRow.value
return [
{
title: '基本信息',
fields: [
{ label: '产品编码', value: row.productCode || '—' },
{ label: '产品名称', value: row.productName || '—' },
{ label: '产品类型', value: row.productTypeName || '—' },
{ label: '规格', value: row.specName || '—' },
{ label: '代次', value: row.passage || '—' },
{ label: '批次号', value: row.batchNo || '—' },
{ label: '储物格位置', value: row.storageSlotName || '—' },
{
label: '预计细胞数量(亿)',
value: row.expectedCellCount != null ? String(row.expectedCellCount) : '—'
},
{
label: '活性(%)',
value: row.viability != null ? String(row.viability) : '—'
},
{ label: '数量', value: row.quantity != null ? String(row.quantity) : '—' },
{ label: '单位', value: row.unit || '—' },
{ label: '冻存日期', value: row.freezeDate || '—' },
{ label: '有效期', value: row.expiryDate || '—' },
{
label: '状态',
value: productStatusTag(row.productStatus).label,
tagType: productStatusTag(row.productStatus).type as
| 'success'
| 'warning'
| 'danger'
| 'info'
| ''
| 'primary'
},
{ label: '备注', value: row.remark || '—', span: true }
]
slot: 'basicInfo',
fields: []
},
{
title: '产品图片',
@@ -1338,6 +1413,172 @@
</script>
<style scoped lang="scss">
.cell-product-basic {
display: flex;
gap: 20px;
align-items: flex-start;
}
.cell-product-basic__content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 14px;
}
.cell-product-basic__summary {
padding: 16px 18px;
border: 1px solid #c5e0d4;
border-radius: 10px;
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 72%);
}
.cell-product-basic__headline {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 8px;
}
.cell-product-basic__name {
font-size: 17px;
font-weight: 700;
color: #1e293b;
line-height: 1.35;
letter-spacing: -0.01em;
}
.cell-product-basic__meta {
font-size: 13px;
color: var(--mint-text-muted, #64748b);
line-height: 1.5;
}
.cell-product-basic__meta-sep {
margin: 0 6px;
color: #cbd5e1;
}
.cell-product-basic__panels {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.cell-product-basic__panel {
padding: 14px 16px;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #fff;
}
.cell-product-basic__panel--remark {
margin-top: 0;
}
.cell-product-basic__panel-title {
margin-bottom: 12px;
padding-left: 8px;
font-size: 12px;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
line-height: 1;
border-left: 2px solid var(--primary, #10b981);
}
.cell-product-basic__grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px 16px;
}
.cell-product-basic__field {
min-width: 0;
}
.cell-product-basic__field--wide {
grid-column: 1 / -1;
}
.cell-product-basic__field-label {
margin-bottom: 4px;
font-size: 12px;
color: var(--mint-text-muted, #64748b);
line-height: 1.4;
}
.cell-product-basic__field-value {
font-size: 14px;
font-weight: 500;
color: #1e293b;
line-height: 1.5;
word-break: break-word;
}
.cell-product-basic__remark {
margin: 0;
font-size: 14px;
font-weight: 400;
color: #334155;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
}
.cell-product-basic__aside {
flex-shrink: 0;
width: 156px;
position: sticky;
top: 0;
}
.cell-product-qr-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 16px 12px;
border: 1px solid #c5e0d4;
border-radius: 10px;
background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
text-align: center;
}
.cell-product-qr-card__label {
margin: 12px 0 6px;
font-size: 12px;
font-weight: 500;
color: var(--mint-text-muted, #64748b);
line-height: 1.4;
}
.cell-product-qr-card__code {
margin: 0;
font-size: 12px;
font-weight: 600;
color: #065f46;
line-height: 1.4;
word-break: break-all;
}
@media (max-width: 960px) {
.cell-product-basic {
flex-direction: column;
}
.cell-product-basic__aside {
width: 100%;
max-width: 180px;
margin: 0 auto;
position: static;
}
.cell-product-basic__panels {
grid-template-columns: 1fr;
}
}
.cell-product-dialog-form {
:deep(.el-form-item) {
margin-bottom: 0;
@@ -273,7 +273,7 @@
>
<div class="route-config-body">
<!-- 左侧:工艺库 -->
<div class="route-config-left">
<div class="route-config-left" v-loading="processLibraryLoading">
<div class="route-config-left-header">
<h3>工艺库</h3>
<el-input
@@ -318,7 +318,7 @@
</el-collapse-item>
</el-collapse>
<el-empty
v-if="filteredProcessLibrary.length === 0"
v-if="filteredProcessLibrary.length === 0 && !processLibraryLoading"
description="暂无工艺数据"
:image-size="48"
/>
@@ -1403,6 +1403,7 @@
// 工艺库数据
const processLibrary = ref<Record<string, any>[]>([])
const processLibraryLoading = ref(false)
const expandedCategories = ref<string[]>([])
const chineseOrdinals = [
'一',
@@ -1829,6 +1830,7 @@
})
async function loadConfigReferenceData() {
processLibraryLoading.value = true
try {
const [processes, categories, sops, outputTypes, equipments] = await Promise.all([
fetchAllProcesses(),
@@ -1871,6 +1873,13 @@
// 展开所有分类
expandedCategories.value = Object.keys(catMap)
processLibrary.value = Object.values(catMap)
} catch {
processLibrary.value = []
expandedCategories.value = []
} finally {
processLibraryLoading.value = false
}
try {
await Promise.all([
searchItemUnitOptions(''),
searchReagentOptions(''),
@@ -101,16 +101,18 @@
<template #footer>
<div v-if="phase === 'form'">
<el-button class="btn-ghost" @click="handleClose">取消</el-button>
<el-button class="btn-main" type="primary" :loading="submitting" @click="handleCreateTask"
>生成任务</el-button
>
<el-button class="btn-ghost" @click="handleClose">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button class="btn-main" type="primary" :loading="submitting" @click="handleCreateTask">
<el-icon><Check /></el-icon>生成任务
</el-button>
</div>
</template>
<!-- 阶段二:三栏编辑 -->
<div v-if="phase === 'edit'" class="route-config-body">
<div class="route-config-left">
<div class="route-config-left" v-loading="processLibraryLoading">
<div class="route-config-left-header">
<h3>工艺库</h3>
<el-input
@@ -151,7 +153,7 @@
</el-collapse-item>
</el-collapse>
<el-empty
v-if="!filteredProcessLibrary.length"
v-if="!filteredProcessLibrary.length && !processLibraryLoading"
description="暂无工艺数据"
:image-size="48"
/>
@@ -223,7 +225,7 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { ElMessage } from 'element-plus'
import { Rank, Plus, CopyDocument, Delete } from '@element-plus/icons-vue'
import { Rank, Plus, CopyDocument, Delete, Close, Check } from '@element-plus/icons-vue'
import { VueDraggable as draggable } from 'vue-draggable-plus'
import { fetchCreateProductionTask } from '@/api/production-task'
import { fetchUserList } from '@/api/admin'
@@ -278,6 +280,7 @@
stepList,
selectedStepId,
stepListLoading,
processLibraryLoading,
processSearchKeyword,
expandedCategories,
filteredProcessLibrary
@@ -79,7 +79,11 @@
<!-- 可折叠工艺库侧栏(只读时隐藏) -->
<template v-if="!readonly">
<transition name="slide-lib">
<div v-show="editor.processLibraryExpanded.value" class="execution-lib-panel">
<div
v-show="editor.processLibraryExpanded.value"
v-loading="editor.processLibraryLoading.value"
class="execution-lib-panel"
>
<div class="execution-lib-header">
<h3>工艺库</h3>
<el-input
@@ -124,7 +128,7 @@
</el-collapse-item>
</el-collapse>
<el-empty
v-if="!editor.filteredProcessLibrary.value.length"
v-if="!editor.filteredProcessLibrary.value.length && !editor.processLibraryLoading.value"
description="暂无工艺数据"
:image-size="48"
/>
@@ -514,6 +518,7 @@
/* 工艺库折叠侧栏 */
.execution-lib-panel {
position: relative;
width: 260px;
flex-shrink: 0;
min-height: 0;
@@ -13,7 +13,7 @@ export function useProductionViewDialog(buildSections: ProductionViewSectionBuil
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
const isOutboundContextView = computed(() => isOutboundProductionView(detail.value))
const viewDialogWidth = computed(() => (isOutboundContextView.value ? '1200px' : '720px'))
const viewDialogWidth = computed(() => (isOutboundContextView.value ? '1280px' : '1120px'))
const viewDialogGridColumns = computed<2 | 3 | 4>(() => (isOutboundContextView.value ? 4 : 2))
const viewDialogCompact = computed(() => isOutboundContextView.value)
@@ -20,10 +20,10 @@
</div>
</div>
<component
:is="activeTabComponent"
<ProductionWorkOrderTabPanel
ref="activeTabRef"
:key="activeTabKey"
:tab-key="activeTabKey"
page-mode="manage"
@dispatch="handleOpenDispatch"
@dispatch-qc="handleOpenDispatchQc"
@@ -115,7 +115,7 @@
parseProductionWorkOrderTabKey,
type ProductionWorkOrderTabKey
} from '@/utils/production-work-order-tabs'
import { getProductionWorkOrderTabComponent } from './tabs/tab-registry'
import ProductionWorkOrderTabPanel from './tabs/ProductionWorkOrderTabPanel.vue'
import DispatchTaskDialog from './DispatchTaskDialog.vue'
import DispatchQcWorkOrderDialog from './DispatchQcWorkOrderDialog.vue'
import WorkOrderRemarkDialog from '@/components/business/work-order-remark-dialog/index.vue'
@@ -135,7 +135,6 @@
const activeTabKey = ref<ProductionWorkOrderTabKey>(
parseProductionWorkOrderTabKey(route.query.tab as string)
)
const activeTabComponent = computed(() => getProductionWorkOrderTabComponent(activeTabKey.value))
async function refreshActiveTab() {
activeTabRef.value?.bumpTaskRefresh()
@@ -88,6 +88,7 @@ export function useTaskStepEditor() {
const stepList = ref<Record<string, any>[]>([])
const selectedStepId = ref('')
const stepListLoading = ref(false)
const processLibraryLoading = ref(false)
const activeSubTab = ref(PROCESS_ROUTE_DEFAULT_SUB_TAB)
const processSearchKeyword = ref('')
const configSuppressSave = ref(false)
@@ -674,39 +675,47 @@ export function useTaskStepEditor() {
})
async function loadConfigReferenceData() {
const [processes, categories, sops, outputTypes, equipments] = await Promise.all([
fetchAllProcesses(),
fetchAllProcessCategories(),
fetchAllSopDocuments(),
fetchAllOutputTypes(),
fetchAllEquipments()
])
categoryOptions.value = categories || []
sopOptions.value = sops || []
outputTypeOptions.value = outputTypes || []
equipmentOptions.value = equipments || []
processLibraryLoading.value = true
try {
const [processes, categories, sops, outputTypes, equipments] = await Promise.all([
fetchAllProcesses(),
fetchAllProcessCategories(),
fetchAllSopDocuments(),
fetchAllOutputTypes(),
fetchAllEquipments()
])
categoryOptions.value = categories || []
sopOptions.value = sops || []
outputTypeOptions.value = outputTypes || []
equipmentOptions.value = equipments || []
const catMap: Record<
string,
{ categoryId: string; categoryName: string; processes: Record<string, any>[] }
> = {}
const uKey = '__uncategorized__'
catMap[uKey] = { categoryId: uKey, categoryName: '未分类', processes: [] }
;(categories || []).forEach((cat: Record<string, any>) => {
catMap[cat.id] = {
categoryId: cat.id,
categoryName: cat.categoryName || cat.name || '未命名分类',
processes: []
}
})
;(processes || []).forEach((proc: Record<string, any>) => {
const catId = proc.categoryId || uKey
if (!catMap[catId])
catMap[catId] = { categoryId: catId, categoryName: '未知分类', processes: [] }
catMap[catId].processes.push(proc)
})
expandedCategories.value = Object.keys(catMap)
processLibrary.value = Object.values(catMap)
const catMap: Record<
string,
{ categoryId: string; categoryName: string; processes: Record<string, any>[] }
> = {}
const uKey = '__uncategorized__'
catMap[uKey] = { categoryId: uKey, categoryName: '未分类', processes: [] }
;(categories || []).forEach((cat: Record<string, any>) => {
catMap[cat.id] = {
categoryId: cat.id,
categoryName: cat.categoryName || cat.name || '未命名分类',
processes: []
}
})
;(processes || []).forEach((proc: Record<string, any>) => {
const catId = proc.categoryId || uKey
if (!catMap[catId])
catMap[catId] = { categoryId: catId, categoryName: '未知分类', processes: [] }
catMap[catId].processes.push(proc)
})
expandedCategories.value = Object.keys(catMap)
processLibrary.value = Object.values(catMap)
} catch {
processLibrary.value = []
expandedCategories.value = []
} finally {
processLibraryLoading.value = false
}
await Promise.all([
searchItemUnitOptions(''),
searchReagentOptions(''),
@@ -1653,6 +1662,7 @@ export function useTaskStepEditor() {
selectedStepId,
selectedStep,
stepListLoading,
processLibraryLoading,
activeSubTab,
processSearchKeyword,
configSuppressSave,
@@ -25,7 +25,7 @@
</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 :data="detail?.products || []" stripe class="list-table view-subtable">
<el-table-column type="index" label="序号" min-width="60" align="center" />
<el-table-column
prop="projectCode"