feat(production): 临床科研出库细胞改由生产确认
市场出库交接对 basic_experiment 保留细胞只读并不改库存;生产工单新增确认出库细胞 API/弹窗,从细胞产品库勾选并联动已售状态。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4de69c37ff
commit
f3672d3cc2
11 files changed
+713
-55
No files matched your search
+8
-1
@@ -31,7 +31,11 @@
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="handover-body">
|
||||
<OutboundMaterialFormSections ref="materialSectionsRef" require-frozen-cell-product />
|
||||
<OutboundMaterialFormSections
|
||||
ref="materialSectionsRef"
|
||||
require-frozen-cell-product
|
||||
:cells-readonly="isBasicExperiment"
|
||||
/>
|
||||
|
||||
<section class="section-card handover-form-section">
|
||||
<h3 class="section-title section-title--mint-bar">交接信息</h3>
|
||||
@@ -264,6 +268,9 @@
|
||||
const pickupTimeLabel = computed(
|
||||
() => getPilotBizConfig(resolvePilotBizType(props.bizType)).pickupTimeLabel
|
||||
)
|
||||
const isBasicExperiment = computed(
|
||||
() => resolvePilotBizType(props.bizType) === 'basic_experiment'
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', val: boolean): void
|
||||
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
<!-- 临床科研出库工单 — 确认出库细胞 -->
|
||||
<!-- eslint-disable vue/no-v-model-argument vue/no-multiple-template-root -->
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="modelValue"
|
||||
title="确认出库细胞"
|
||||
width="1100px"
|
||||
class="dialog-form-layout production-delivery-cell-outbound-dialog"
|
||||
align-center
|
||||
append-to-body
|
||||
modal-class="protocol-dialog-mask"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
style="backdrop-filter: none"
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div v-if="scheduleSummary" class="material-summary">
|
||||
<div class="material-summary-row">
|
||||
<span class="material-summary-label">工单号</span>
|
||||
<span class="material-summary-value">{{ workOrderNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="material-summary-row">
|
||||
<span class="material-summary-label">申请单号</span>
|
||||
<span class="material-summary-value">{{ scheduleSummary.applicationNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="material-summary-row">
|
||||
<span class="material-summary-label">课题名称</span>
|
||||
<span class="material-summary-value">{{ scheduleSummary.projectTitle || '—' }}</span>
|
||||
</div>
|
||||
<div class="material-summary-row">
|
||||
<span class="material-summary-label">客户名称</span>
|
||||
<span class="material-summary-value">{{ scheduleSummary.customerName || '—' }}</span>
|
||||
</div>
|
||||
<div class="material-summary-row">
|
||||
<span class="material-summary-label">交付时间</span>
|
||||
<span class="material-summary-value">{{ scheduleSummary.infusionTime || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="outbound-body">
|
||||
<OutboundMaterialFormSections
|
||||
ref="materialSectionsRef"
|
||||
require-frozen-cell-product
|
||||
:show-materials="false"
|
||||
:show-papers="false"
|
||||
:show-remark="false"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="emit('update:modelValue', false)">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
<el-icon><Check /></el-icon>
|
||||
确认出库
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Check, Close } from '@element-plus/icons-vue'
|
||||
import {
|
||||
fetchProductionDeliveryCellOutbound,
|
||||
saveProductionDeliveryCellOutbound
|
||||
} from '@/api/production-work-order'
|
||||
import OutboundMaterialFormSections from '@/components/business/outbound-material-form-sections/index.vue'
|
||||
|
||||
defineOptions({ name: 'ProductionDeliveryCellOutboundDialog' })
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
workOrderId: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', val: boolean): void
|
||||
(e: 'saved'): void
|
||||
}>()
|
||||
|
||||
const materialSectionsRef = ref<InstanceType<typeof OutboundMaterialFormSections> | null>(null)
|
||||
const loading = ref(false)
|
||||
const submitting = ref(false)
|
||||
const workOrderNo = ref('')
|
||||
const scheduleSummary = ref<{
|
||||
applicationNo?: string
|
||||
patientName?: string
|
||||
infusionTime?: string
|
||||
projectTitle?: string
|
||||
customerName?: string
|
||||
} | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
if (!props.workOrderId) return
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await fetchProductionDeliveryCellOutbound(props.workOrderId)
|
||||
workOrderNo.value = data.workOrderNo || ''
|
||||
scheduleSummary.value = data.scheduleSummary || null
|
||||
await nextTick()
|
||||
materialSectionsRef.value?.loadFromApiData({
|
||||
cells: data.cells as any
|
||||
})
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '加载出库细胞失败')
|
||||
emit('update:modelValue', false)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!props.workOrderId) return
|
||||
if (!materialSectionsRef.value?.validateMaterial()) return
|
||||
const payload = materialSectionsRef.value.buildSavePayload()
|
||||
submitting.value = true
|
||||
try {
|
||||
await saveProductionDeliveryCellOutbound(props.workOrderId, {
|
||||
cells: (payload.cells || []).map((c: { cellProductId: string; remark?: string }) => ({
|
||||
cellProductId: c.cellProductId,
|
||||
remark: c.remark
|
||||
}))
|
||||
})
|
||||
ElMessage.success('出库细胞已确认')
|
||||
emit('saved')
|
||||
emit('update:modelValue', false)
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '确认出库失败')
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleClosed() {
|
||||
workOrderNo.value = ''
|
||||
scheduleSummary.value = null
|
||||
materialSectionsRef.value?.resetState()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(visible) => {
|
||||
if (visible) void loadData()
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.material-summary {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 16px;
|
||||
background: var(--el-fill-color-lighter);
|
||||
border-radius: 8px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px 24px;
|
||||
}
|
||||
|
||||
.material-summary-row {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.material-summary-label {
|
||||
flex: 0 0 auto;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.material-summary-value {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.outbound-body {
|
||||
min-height: 160px;
|
||||
}
|
||||
</style>
|
||||
+18
-1
@@ -75,6 +75,13 @@
|
||||
<el-button class="btn-op-item" @click="emit('view-qc', row)">
|
||||
<el-icon><DataLine /></el-icon>查看质检数据
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showDeliveryCellOutbound(row)"
|
||||
class="btn-op-item"
|
||||
@click="emit('delivery-cell-outbound', row)"
|
||||
>
|
||||
<el-icon><Box /></el-icon>确认出库细胞
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showStorageCertQcButton(row)"
|
||||
class="btn-op-item"
|
||||
@@ -353,7 +360,8 @@
|
||||
ArrowDown,
|
||||
ArrowUp,
|
||||
DataLine,
|
||||
FolderAdd
|
||||
FolderAdd,
|
||||
Box
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { ProductionWorkOrderItem } from '@/api/production-work-order'
|
||||
import type { OutboundQcDetailProduct } from '@/api/qc-work-order'
|
||||
@@ -545,6 +553,7 @@
|
||||
const emit = defineEmits<{
|
||||
view: [row: ProductionWorkOrderItem]
|
||||
'view-qc': [row: ProductionWorkOrderItem]
|
||||
'delivery-cell-outbound': [row: ProductionWorkOrderItem]
|
||||
dispatch: [row: ProductionWorkOrderItem]
|
||||
'dispatch-qc': [row: ProductionWorkOrderItem]
|
||||
complete: [row: ProductionWorkOrderItem]
|
||||
@@ -649,6 +658,14 @@
|
||||
return row.workOrderStatus === 'dpz' || row.workOrderStatus === 'jxz'
|
||||
}
|
||||
|
||||
function showDeliveryCellOutbound(row: ProductionWorkOrderItem) {
|
||||
if (isMineMode.value) return false
|
||||
if (row.workOrderStatus === 'yzf') return false
|
||||
const tabKey = resolveEffectiveRowTabKey(listTabKey.value, row)
|
||||
if (tabKey === 'outbound_basic_experiment') return true
|
||||
return row.bizType === 'basic_experiment' && (row.workOrderType || '') === 'outbound'
|
||||
}
|
||||
|
||||
function canVoidWorkOrder(row: ProductionWorkOrderItem) {
|
||||
return row.workOrderStatus === 'dpz' || row.workOrderStatus === 'jxz'
|
||||
}
|
||||
|
||||
+20
@@ -189,6 +189,7 @@
|
||||
:tasks-batch-loading="tasksBatchLoading"
|
||||
@view="handleView"
|
||||
@view-qc="handleViewQc"
|
||||
@delivery-cell-outbound="handleDeliveryCellOutbound"
|
||||
@dispatch="(row) => emit('dispatch', row)"
|
||||
@dispatch-qc="(row) => emit('dispatch-qc', row)"
|
||||
@complete="(row) => emit('complete', row)"
|
||||
@@ -229,6 +230,12 @@
|
||||
:tasks="saveSetTasks"
|
||||
:lab-storage-code="saveSetLabStorageCode"
|
||||
/>
|
||||
|
||||
<ProductionDeliveryCellOutboundDialog
|
||||
v-model="deliveryCellOutboundVisible"
|
||||
:work-order-id="deliveryCellOutboundWorkOrderId"
|
||||
@saved="handleDeliveryCellOutboundSaved"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -242,6 +249,7 @@
|
||||
import { PRODUCTION_WORK_ORDER_STATUS_FILTER_OPTIONS } from '@/utils/status-tag-registry'
|
||||
import ProductionWorkOrderCardList from '../ProductionWorkOrderCardList.vue'
|
||||
import ProductionWorkOrderQcViewDialog from '../ProductionWorkOrderQcViewDialog.vue'
|
||||
import ProductionDeliveryCellOutboundDialog from '../ProductionDeliveryCellOutboundDialog.vue'
|
||||
import SampleReceptionDialog from '../SampleReceptionDialog.vue'
|
||||
import SaveProductionTaskSetDialog from '../SaveProductionTaskSetDialog.vue'
|
||||
import { PRODUCTION_WORK_ORDER_VIEW_DIALOG_COMPONENTS } from '../view-dialogs/view-dialog-registry'
|
||||
@@ -283,6 +291,8 @@
|
||||
const saveSetLabStorageCode = computed(() =>
|
||||
resolveWorkOrderLabStorageCode(saveSetRow.value)
|
||||
)
|
||||
const deliveryCellOutboundVisible = ref(false)
|
||||
const deliveryCellOutboundWorkOrderId = ref('')
|
||||
|
||||
const {
|
||||
cardMetaConfig,
|
||||
@@ -366,6 +376,16 @@
|
||||
qcViewVisible.value = true
|
||||
}
|
||||
|
||||
function handleDeliveryCellOutbound(row: ProductionWorkOrderItem) {
|
||||
deliveryCellOutboundWorkOrderId.value = row.id || ''
|
||||
deliveryCellOutboundVisible.value = true
|
||||
}
|
||||
|
||||
function handleDeliveryCellOutboundSaved() {
|
||||
loadData()
|
||||
emit('data-changed')
|
||||
}
|
||||
|
||||
function handleSampleReceptionSuccess() {
|
||||
bumpTaskRefresh()
|
||||
loadData()
|
||||
|
||||
Reference in new issue
Block a user