提交
This commit is contained in:
1 parent
6bfabac50d
commit
58a47b96a5
38 files changed
+10159
-9660
No files matched your search
@@ -1639,6 +1639,133 @@
|
||||
return items.length ? items.join(',') : '—'
|
||||
})
|
||||
|
||||
/** 未完成结算的输注计划(已完成/已取消不再扣减) */
|
||||
const isPendingSettlementSchedule = (schedule: Record<string, any>): boolean => {
|
||||
const st = normalizeInfusionStatusCode(schedule.infusionStatus)
|
||||
return st !== 'ywc' && st !== 'yqx'
|
||||
}
|
||||
|
||||
const resolveYfkUnitPrice = (cp: Record<string, any>): number => {
|
||||
const agreement = Number(cp.agreementPrice)
|
||||
if (agreement > 0) return agreement
|
||||
return Number(cp.actualPrice) || 0
|
||||
}
|
||||
|
||||
const calcPendingSettlementAmount = (): number =>
|
||||
infusionSchedules.value
|
||||
.filter(isPendingSettlementSchedule)
|
||||
.reduce(
|
||||
(sum, s) =>
|
||||
sum +
|
||||
(s.cellProducts || []).reduce((lineSum: number, cp: any) => {
|
||||
const qty = Math.max(1, Number(cp.quantity) || 1)
|
||||
return lineSum + resolveYfkUnitPrice(cp) * qty
|
||||
}, 0),
|
||||
0
|
||||
)
|
||||
|
||||
type PendingProductQtyItem = {
|
||||
label: string
|
||||
qty: number
|
||||
projectCode: string
|
||||
specText: string
|
||||
cellTypeName: string
|
||||
}
|
||||
|
||||
const calcPendingSettlementQtyByProduct = (): Map<string, PendingProductQtyItem> => {
|
||||
const map = new Map<string, PendingProductQtyItem>()
|
||||
for (const schedule of infusionSchedules.value.filter(isPendingSettlementSchedule)) {
|
||||
for (const cp of schedule.cellProducts || []) {
|
||||
const projectCode = (cp.projectCode || '').trim()
|
||||
const specText = (cp.specText || '').trim()
|
||||
const cellTypeName = (cp.cellTypeName || '').trim()
|
||||
const key = projectCode ? `${projectCode}|${specText}` : `${cellTypeName}|${specText}`
|
||||
if (!key.replace('|', '').trim()) continue
|
||||
const qty = Math.max(1, Number(cp.quantity) || 1)
|
||||
const label = formatCellProductDisplayLabel(cp)
|
||||
const existing = map.get(key)
|
||||
if (existing) {
|
||||
existing.qty += qty
|
||||
} else {
|
||||
map.set(key, { label, qty, projectCode, specText, cellTypeName })
|
||||
}
|
||||
}
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
const findOrderProductCurrentQty = (
|
||||
orderProducts: any[],
|
||||
item: PendingProductQtyItem
|
||||
): number | null => {
|
||||
const spec = item.specText
|
||||
if (item.projectCode) {
|
||||
const row = orderProducts.find(
|
||||
(p) => (p.projectCode || '') === item.projectCode && (p.specText || '') === spec
|
||||
)
|
||||
if (row) return Number(row.currentQty) || 0
|
||||
}
|
||||
if (item.cellTypeName) {
|
||||
const row = orderProducts.find(
|
||||
(p) =>
|
||||
(p.cellType || p.cellTypeName || '') === item.cellTypeName && (p.specText || '') === spec
|
||||
)
|
||||
if (row) return Number(row.currentQty) || 0
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/** 保存前校验渠道服务订单余额/份数,仅提示不阻断保存 */
|
||||
const warnIfChannelSettlementInsufficient = async () => {
|
||||
if (isClinical.value || isBasicExperiment.value) return
|
||||
if (!formData.channelServiceOrderId || !formData.channelId) return
|
||||
|
||||
const pendingSchedules = infusionSchedules.value.filter(isPendingSettlementSchedule)
|
||||
const hasProducts = pendingSchedules.some((s) => (s.cellProducts || []).length > 0)
|
||||
if (!hasProducts) return
|
||||
|
||||
let orderDetail: any
|
||||
try {
|
||||
const res: any = await fetchChannelServiceOrderDetail(formData.channelServiceOrderId)
|
||||
orderDetail = res?.data ?? res
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
const orderType = orderDetail?.orderType || selectedServiceOrder.value?.orderType || ''
|
||||
|
||||
if (orderType === 'yfk') {
|
||||
const required = calcPendingSettlementAmount()
|
||||
if (required <= 0) return
|
||||
const balance = Number(orderDetail.currentBalance) || 0
|
||||
if (balance < required) {
|
||||
ElMessage.warning(
|
||||
`渠道服务订单余额可能不足:当前余额 ¥${formatMoneyDisplay(balance, 2)},待完成输注计划预估需 ¥${formatMoneyDisplay(required, 2)}。申请单仍会保存,完成输注时可能扣减失败。`
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (orderType === 'gmcp') {
|
||||
const orderProducts = Array.isArray(orderDetail.products) ? orderDetail.products : []
|
||||
const requiredMap = calcPendingSettlementQtyByProduct()
|
||||
const shortfalls: string[] = []
|
||||
for (const item of requiredMap.values()) {
|
||||
const available = findOrderProductCurrentQty(orderProducts, item)
|
||||
if (available === null) {
|
||||
shortfalls.push(`「${item.label}」在服务订单中未找到持仓`)
|
||||
} else if (available < item.qty) {
|
||||
shortfalls.push(`「${item.label}」当前剩余 ${available} 份,预估需 ${item.qty} 份`)
|
||||
}
|
||||
}
|
||||
if (shortfalls.length) {
|
||||
ElMessage.warning(
|
||||
`渠道服务订单产品份数可能不足:${shortfalls.join(';')}。申请单仍会保存,完成输注时可能扣减失败。`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getCellProductProjectKey = (cp: any): string =>
|
||||
(cp?.projectCode || cp?.priceId || '').trim()
|
||||
|
||||
@@ -2742,6 +2869,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
await warnIfChannelSettlementInsufficient()
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
const attachmentPayload = otherFileList.value.map((a) => ({
|
||||
|
||||
+244
-119
@@ -6,119 +6,172 @@
|
||||
<header class="production-work-order-card__head">
|
||||
<div class="production-work-order-card__title-band">
|
||||
<div class="production-work-order-card__title-row">
|
||||
<el-checkbox
|
||||
v-if="!isMineMode"
|
||||
:model-value="isSelected(row.id)"
|
||||
class="production-work-order-card__checkbox"
|
||||
@change="(val) => handleCardSelect(row, Boolean(val))"
|
||||
/>
|
||||
<span class="production-work-order-card__index">{{ cardIndex(idx) }}</span>
|
||||
<span class="production-work-order-card__no">{{ row.workOrderNo || '—' }}</span>
|
||||
<el-tag :type="productionWoStatusTag(row.workOrderStatus).type" size="small">
|
||||
{{ productionWoStatusTag(row.workOrderStatus).label }}
|
||||
</el-tag>
|
||||
<div class="production-work-order-card__title-left">
|
||||
<el-checkbox
|
||||
v-if="!isMineMode"
|
||||
:model-value="isSelected(row.id)"
|
||||
class="production-work-order-card__checkbox"
|
||||
@change="(val) => handleCardSelect(row, Boolean(val))"
|
||||
/>
|
||||
<span class="production-work-order-card__index">{{ cardIndex(idx) }}</span>
|
||||
<span class="production-work-order-card__no">{{ row.workOrderNo || '—' }}</span>
|
||||
<el-tag :type="productionWoStatusTag(row.workOrderStatus).type" size="small">
|
||||
{{ productionWoStatusTag(row.workOrderStatus).label }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="showCardOpsRow" class="production-work-order-card__ops">
|
||||
<el-button
|
||||
v-if="isMineMode"
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="emit('view', row)"
|
||||
>
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="showCardDispatchComplete && canDispatchTask(row)"
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="emit('dispatch', row)"
|
||||
>
|
||||
<el-icon><Position /></el-icon>派发任务
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="!canDispatchTask(row)"
|
||||
class="btn-op-item primary"
|
||||
@click="emit('view', row)"
|
||||
>
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-tooltip
|
||||
v-if="!isMineMode && cardMeta.allowDispatchQc"
|
||||
:content="dispatchQcTooltip(row)"
|
||||
:disabled="canDispatchQc(row)"
|
||||
placement="top"
|
||||
>
|
||||
<span>
|
||||
<el-button
|
||||
class="btn-op-item"
|
||||
:disabled="!canDispatchQc(row)"
|
||||
@click="emit('dispatch-qc', row)"
|
||||
>
|
||||
<el-icon><Document /></el-icon>派发质检工单
|
||||
</el-button>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-if="cardMeta.allowSampleReception"
|
||||
class="btn-op-item"
|
||||
@click="emit('open-sample-reception', row)"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>样本接收信息填写
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!isMineMode && showCardDispatchComplete && canComplete(row)"
|
||||
class="btn-op-item"
|
||||
@click="emit('complete', row)"
|
||||
>
|
||||
<el-icon><Check /></el-icon>完成工单
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
v-if="!isMineMode && hasMoreActions(row)"
|
||||
trigger="hover"
|
||||
@command="(cmd) => emit('command', cmd, row)"
|
||||
>
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="canDispatchTask(row)" command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="canEditWorkOrder(row)" command="edit">
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="canDeleteWorkOrder(row)" command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="production-work-order-card__head-body">
|
||||
<div class="production-work-order-card__head-main">
|
||||
<dl class="production-work-order-card__meta">
|
||||
<template v-for="field in visibleMetaFields(row)" :key="field.label">
|
||||
<div
|
||||
class="production-work-order-card__meta-item"
|
||||
:class="{ 'production-work-order-card__meta-item--wide': field.wide }"
|
||||
>
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>
|
||||
<el-tag
|
||||
v-if="field.kind === 'tag'"
|
||||
:type="field.getTagType?.(row) || 'info'"
|
||||
size="small"
|
||||
>
|
||||
{{ field.getValue(row) }}
|
||||
</el-tag>
|
||||
<template v-else>{{ field.getValue(row) }}</template>
|
||||
</dd>
|
||||
</div>
|
||||
</template>
|
||||
</dl>
|
||||
</div>
|
||||
<div v-if="showCardOpsRow" class="production-work-order-card__ops">
|
||||
<el-button
|
||||
v-if="isMineMode"
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="emit('view', row)"
|
||||
>
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="showCardDispatchComplete && canDispatchTask(row)"
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="emit('dispatch', row)"
|
||||
>
|
||||
<el-icon><Position /></el-icon>派发任务
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="!canDispatchTask(row)"
|
||||
class="btn-op-item primary"
|
||||
@click="emit('view', row)"
|
||||
>
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-tooltip
|
||||
v-if="!isMineMode && cardMeta.allowDispatchQc"
|
||||
:content="dispatchQcTooltip(row)"
|
||||
:disabled="canDispatchQc(row)"
|
||||
placement="top"
|
||||
>
|
||||
<span>
|
||||
<el-button
|
||||
class="btn-op-item"
|
||||
:disabled="!canDispatchQc(row)"
|
||||
@click="emit('dispatch-qc', row)"
|
||||
<dl class="production-work-order-card__meta">
|
||||
<template v-for="field in visibleMetaFields(row)" :key="field.label">
|
||||
<div
|
||||
class="production-work-order-card__meta-item"
|
||||
:class="{ 'production-work-order-card__meta-item--wide': field.wide }"
|
||||
>
|
||||
<el-icon><Document /></el-icon>派发质检工单
|
||||
</el-button>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-if="cardMeta.allowSampleReception"
|
||||
class="btn-op-item"
|
||||
@click="emit('open-sample-reception', row)"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>样本接收信息填写
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!isMineMode && showCardDispatchComplete && canComplete(row)"
|
||||
class="btn-op-item"
|
||||
@click="emit('complete', row)"
|
||||
>
|
||||
<el-icon><Check /></el-icon>完成工单
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
v-if="!isMineMode && hasMoreActions(row)"
|
||||
trigger="hover"
|
||||
@command="(cmd) => emit('command', cmd, row)"
|
||||
>
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-if="canDispatchTask(row)" command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="canEditWorkOrder(row)" command="edit">
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="canDeleteWorkOrder(row)" command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>
|
||||
<el-tag
|
||||
v-if="field.kind === 'tag'"
|
||||
:type="field.getTagType?.(row) || 'info'"
|
||||
size="small"
|
||||
>
|
||||
{{ field.getValue(row) }}
|
||||
</el-tag>
|
||||
<template v-else>{{ field.getValue(row) }}</template>
|
||||
</dd>
|
||||
</div>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</dl>
|
||||
<section v-if="cardMeta.showCellProducts" class="production-work-order-card__cells">
|
||||
<div v-if="cellProducts(row).length" class="production-work-order-card__cell-list">
|
||||
<div
|
||||
v-for="(product, pi) in cellProducts(row)"
|
||||
:key="`${product.projectCode || product.projectName || pi}`"
|
||||
class="production-work-order-card__cell-item"
|
||||
>
|
||||
<dl class="production-work-order-card__cell-fields">
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>项目编码</dt>
|
||||
<dd>{{ product.projectCode || '—' }}</dd>
|
||||
</div>
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>项目名称</dt>
|
||||
<dd>{{ product.projectName || '—' }}</dd>
|
||||
</div>
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>细胞类型</dt>
|
||||
<dd>{{ product.cellTypeName || row.cellType || '—' }}</dd>
|
||||
</div>
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>规格</dt>
|
||||
<dd>{{ product.specText || row.specText || '—' }}</dd>
|
||||
</div>
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>数量</dt>
|
||||
<dd>{{ product.quantity != null ? product.quantity : '—' }}</dd>
|
||||
</div>
|
||||
<div class="production-work-order-card__cell-field">
|
||||
<dt>产品状态</dt>
|
||||
<dd>
|
||||
<el-tag
|
||||
v-if="product.productStatus"
|
||||
:type="productStatusTagType(product.productStatus) as TagType"
|
||||
size="small"
|
||||
>
|
||||
{{ productStatusLabel(product.productStatus, row.bizType || '') }}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<p v-else class="production-work-order-card__cells-fallback">
|
||||
<template v-if="row.cellType || row.specText">
|
||||
<span v-if="row.cellType">细胞类型:{{ row.cellType }}</span>
|
||||
<span v-if="row.cellType && row.specText"> · </span>
|
||||
<span v-if="row.specText">规格:{{ row.specText }}</span>
|
||||
</template>
|
||||
<template v-else>暂无细胞产品明细</template>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</header>
|
||||
<QcWorkOrderProtocolPaymentPanel
|
||||
@@ -168,9 +221,11 @@
|
||||
import { computed } from 'vue'
|
||||
import { View, Position, Document, Check, More, EditPen, Delete } from '@element-plus/icons-vue'
|
||||
import type { ProductionWorkOrderItem } from '@/api/production-work-order'
|
||||
import type { OutboundQcDetailProduct } from '@/api/qc-work-order'
|
||||
import type { ProductionWorkOrderCardMetaConfig } from '@/utils/production-work-order-card-meta'
|
||||
import { getCardMetaConfigForLegacyTab } from '@/utils/production-work-order-card-meta'
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
import { productStatusLabel, productStatusTagType } from '@/utils/status-tag-registry'
|
||||
import WorkOrderTaskSubList from './WorkOrderTaskSubList.vue'
|
||||
import QcWorkOrderFeeSummaryBar from '@/views/quality-inspection/qc-work-order/QcWorkOrderFeeSummaryBar.vue'
|
||||
import QcWorkOrderProtocolPaymentPanel from '@/views/quality-inspection/qc-work-order/QcWorkOrderProtocolPaymentPanel.vue'
|
||||
@@ -238,6 +293,10 @@
|
||||
return cardMeta.value.showOutboundFeeSummary && !!row.feeSummary
|
||||
}
|
||||
|
||||
function cellProducts(row: ProductionWorkOrderItem): OutboundQcDetailProduct[] {
|
||||
return row.products?.length ? row.products : []
|
||||
}
|
||||
|
||||
function productionWoStatusTag(status: string): { label: string; type: TagType } {
|
||||
const map: Record<string, { label: string; type: TagType }> = {
|
||||
dpz: { label: '待配置', type: 'info' },
|
||||
@@ -351,23 +410,27 @@
|
||||
|
||||
.production-work-order-card__head-body {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
gap: 12px 20px;
|
||||
padding: 14px 16px;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.production-work-order-card__head-main {
|
||||
flex: 1;
|
||||
min-width: 280px;
|
||||
}
|
||||
|
||||
.production-work-order-card__title-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px 12px;
|
||||
}
|
||||
|
||||
.production-work-order-card__title-left {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.production-work-order-card__checkbox {
|
||||
@@ -423,14 +486,76 @@
|
||||
}
|
||||
}
|
||||
|
||||
.production-work-order-card__cells {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.production-work-order-card__cell-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.production-work-order-card__cell-item {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.production-work-order-card__cell-fields {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px 12px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.production-work-order-card__cell-field {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
|
||||
dt {
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: #b91c1c;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
|
||||
&::after {
|
||||
content: ':';
|
||||
}
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #dc2626;
|
||||
line-height: 1.4;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.production-work-order-card__cells-fallback {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #dc2626;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.production-work-order-card__ops {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
align-self: flex-end;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
:deep(.production-work-order-card__fee-in-head) {
|
||||
|
||||
@@ -42,6 +42,76 @@
|
||||
</div>
|
||||
</template>
|
||||
</dl>
|
||||
<section
|
||||
v-if="showCellProductSection(row)"
|
||||
class="qc-work-order-card__cells"
|
||||
>
|
||||
<template v-if="isScheduleTrigger(row)">
|
||||
<div v-if="scheduleCellProducts(row).length" class="qc-work-order-card__cell-list">
|
||||
<div
|
||||
v-for="(product, pi) in scheduleCellProducts(row)"
|
||||
:key="`${product.projectCode || product.projectName || pi}`"
|
||||
class="qc-work-order-card__cell-item"
|
||||
>
|
||||
<dl class="qc-work-order-card__cell-fields">
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>项目编码</dt>
|
||||
<dd>{{ product.projectCode || '—' }}</dd>
|
||||
</div>
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>项目名称</dt>
|
||||
<dd>{{ product.projectName || '—' }}</dd>
|
||||
</div>
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>细胞类型</dt>
|
||||
<dd>{{ product.cellTypeName || row.cellType || '—' }}</dd>
|
||||
</div>
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>规格</dt>
|
||||
<dd>{{ product.specText || row.specText || '—' }}</dd>
|
||||
</div>
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>数量</dt>
|
||||
<dd>{{ product.quantity != null ? product.quantity : '—' }}</dd>
|
||||
</div>
|
||||
<div class="qc-work-order-card__cell-field">
|
||||
<dt>产品状态</dt>
|
||||
<dd>
|
||||
<el-tag
|
||||
v-if="product.productStatus"
|
||||
:type="productStatusTagType(product.productStatus) as TagType"
|
||||
size="small"
|
||||
>
|
||||
{{ productStatusLabel(product.productStatus, row.bizType || '') }}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<p v-else class="qc-work-order-card__cells-fallback">
|
||||
<template v-if="row.cellType || row.specText">
|
||||
<span v-if="row.cellType">细胞类型:{{ row.cellType }}</span>
|
||||
<span v-if="row.cellType && row.specText"> · </span>
|
||||
<span v-if="row.specText">规格:{{ row.specText }}</span>
|
||||
</template>
|
||||
<template v-else>暂无细胞产品明细</template>
|
||||
</p>
|
||||
</template>
|
||||
<template v-else-if="isProductionTrigger(row)">
|
||||
<dl class="qc-work-order-card__cell-fields">
|
||||
<div
|
||||
v-for="field in productionCellProductFields(row)"
|
||||
:key="field.label"
|
||||
class="qc-work-order-card__cell-field"
|
||||
>
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>{{ field.value }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</section>
|
||||
</div>
|
||||
<div
|
||||
v-if="showWorkOrderOps || showWorkOrderViewOnly"
|
||||
@@ -122,10 +192,11 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Setting, View, More, EditPen, Delete } from '@element-plus/icons-vue'
|
||||
import type { QcWorkOrder } from '@/api/qc-work-order'
|
||||
import type { QcWorkOrder, OutboundQcDetailProduct } from '@/api/qc-work-order'
|
||||
import type { QcTask } from '@/api/qc-task'
|
||||
import { workOrderStatusLabel } from '@/utils/qc-labels'
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
import { productStatusLabel, productStatusTagType } from '@/utils/status-tag-registry'
|
||||
import type { QcWorkOrderCardMetaConfig } from '@/utils/qc-work-order-card-meta'
|
||||
import { triggerSourceTabLabel, temporaryQcSourceLabel, temporaryQcSourceTagType } from '@/utils/qc-work-order-groups'
|
||||
import QcWorkOrderTaskSubList from './QcWorkOrderTaskSubList.vue'
|
||||
@@ -181,6 +252,35 @@
|
||||
return 'success'
|
||||
}
|
||||
|
||||
function showCellProductSection(row: QcWorkOrder) {
|
||||
if (!props.cardMetaConfig.showCellProducts) return false
|
||||
const ts = row.triggerSource || ''
|
||||
return ts === 'schedule' || ts === 'production'
|
||||
}
|
||||
|
||||
function isScheduleTrigger(row: QcWorkOrder) {
|
||||
return (row.triggerSource || '') === 'schedule'
|
||||
}
|
||||
|
||||
function isProductionTrigger(row: QcWorkOrder) {
|
||||
return row.triggerSource === 'production'
|
||||
}
|
||||
|
||||
function scheduleCellProducts(row: QcWorkOrder): OutboundQcDetailProduct[] {
|
||||
return row.products?.length ? row.products : []
|
||||
}
|
||||
|
||||
function productionCellProductFields(row: QcWorkOrder) {
|
||||
const val = (v?: string | null) => String(v || '').trim() || '—'
|
||||
return [
|
||||
{ label: '产品编码', value: val(row.cellProductCode) },
|
||||
{ label: '产品名称', value: val(row.cellProductName) },
|
||||
{ label: '产品类型', value: val(row.cellProductTypeName) },
|
||||
{ label: '代次', value: val(row.cellProductPassage) },
|
||||
{ label: '规格', value: val(row.cellProductSpecName) }
|
||||
]
|
||||
}
|
||||
|
||||
function resolveTriggerTagLabel(row: QcWorkOrder) {
|
||||
if (props.cardMetaConfig.tabKey === 'temporary') {
|
||||
return temporaryQcSourceLabel(row)
|
||||
@@ -325,6 +425,69 @@
|
||||
}
|
||||
}
|
||||
|
||||
.qc-work-order-card__cells {
|
||||
margin-top: 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.qc-work-order-card__cell-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.qc-work-order-card__cell-item {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.qc-work-order-card__cell-fields {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px 12px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.qc-work-order-card__cell-field {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
|
||||
dt {
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: #b91c1c;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
|
||||
&::after {
|
||||
content: ':';
|
||||
}
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #dc2626;
|
||||
line-height: 1.4;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.qc-work-order-card__cells-fallback {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #dc2626;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
:deep(.qc-work-order-card__fee-in-head) {
|
||||
align-self: stretch;
|
||||
width: calc(100% + 32px);
|
||||
|
||||
Reference in new issue
Block a user