This commit is contained in:
zlwu committed 2026-05-28 13:05:46 +08:00
1 parent f1f5d24eff
commit 3c7a47981a
138 files changed
+18654 -12092

No files matched your search

@@ -37,7 +37,10 @@
<div class="section-title">
<div class="section-title-left"><h3>申请单信息</h3></div>
</div>
<div class="form-grid form-grid--col4">
<div
class="form-grid form-grid--col4"
:class="{ 'clinical-application-info-grid': isClinical }"
>
<el-form-item label="申请单名称" prop="applicationName">
<el-input v-model="formData.applicationName" placeholder="请输入申请单名称" />
</el-form-item>
@@ -59,6 +62,18 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-if="isClinical"
label="备注"
class="clinical-application-remark"
>
<el-input
v-model="formData.remark"
type="textarea"
placeholder="请输入备注"
:rows="2"
/>
</el-form-item>
<el-form-item
v-if="!isClinical"
label="服务订单"
@@ -92,7 +107,7 @@
</el-button>
</div>
</el-form-item>
<el-form-item label="备注" class="form-col-full">
<el-form-item v-if="!isClinical" label="备注" class="form-col-full">
<el-input
v-model="formData.remark"
type="textarea"
@@ -173,7 +188,12 @@
<el-form-item label="紧急联系人电话" prop="emergencyPhone">
<el-input v-model="patientForm.emergencyPhone" placeholder="请输入紧急联系人电话" />
</el-form-item>
<el-form-item label="是否需要体检" prop="needCheckup" class="patient-checkup-field">
<el-form-item
v-if="!isClinical"
label="是否需要体检"
prop="needCheckup"
class="patient-checkup-field"
>
<el-switch
v-model="patientForm.needCheckup"
:active-value="1"
@@ -266,7 +286,7 @@
请先在「申请单信息」中选择渠道与服务订单,系统将按订单类型加载协议与可选细胞产品。
</p>
<p v-if="isClinical" class="section-title-hint">
请先在「申请单信息」中选择渠道,系统将加载可选细胞产品。
请先选择渠道并添加输注计划;细胞项目从「细胞价格体系」加载(与渠道协议无关)。
</p>
</div>
</div>
@@ -479,7 +499,11 @@
</el-table-column>
<el-table-column prop="cellTypeName" label="细胞类型" min-width="100" />
<el-table-column prop="specText" label="规格" min-width="100" />
<el-table-column label="协议单价(元)" min-width="130" align="right">
<el-table-column
:label="isClinical ? '参考单价(元)' : '协议单价(元)'"
min-width="130"
align="right"
>
<template #default="{ row }">
<span class="cell-product-price-text">
¥{{ formatOrderBalance(row.agreementPrice) }}
@@ -799,6 +823,7 @@
fetchPilotPatient,
fetchChannelAgreements,
fetchChannelAgreementPrices,
fetchCellProductPriceList,
fetchDictDataOptions,
fetchCustomerList,
fetchCreateCustomer
@@ -935,15 +960,20 @@
const onChannelChange = async (channelId: string) => {
formData.channelServiceOrderId = ''
serviceOrderOptions.value = []
resetInfusionOrderContext()
if (!channelId) return
if (isClinical.value) {
// 临床模式:直接加载渠道协议,无需服务订单
await loadAgreements(channelId)
// 临床:价格池与渠道无关;切换渠道时勿清空 agreementPriceOptions(否则「添加细胞产品」会失效)
clearScheduleCellProducts()
if (!channelId) return
if (!agreementPriceOptions.value.length) {
await loadClinicalCellProductPrices()
}
return
}
resetInfusionOrderContext()
if (!channelId) return
serviceOrderLoading.value = true
try {
serviceOrderOptions.value = await fetchAllPagedRecords((page, pageSize) =>
@@ -1089,7 +1119,6 @@
const canAddCellProduct = computed(() => {
if (isClinical.value) {
// 临床模式:需要渠道和协议价格
return !!formData.channelId && agreementPriceOptions.value.length > 0
}
return !!selectedServiceOrder.value && agreementPriceOptions.value.length > 0
@@ -1662,6 +1691,41 @@
}))
}
const normalizeCellProductPriceRows = (rows: any[]) => {
return (Array.isArray(rows) ? rows : []).map((p) => ({
priceId: p.id,
projectCode: p.projectCode || '',
projectName: p.projectName || '',
cellTypeCode: p.cellTypeCode || '',
cellTypeName: p.cellTypeName || '',
specText: p.specText || '',
unitPrice: p.unitPrice ?? 0,
source: 'cell_price' as const
}))
}
/** 临床申请单:从细胞价格体系(biz_cell_product_price)加载可选项目 */
const loadClinicalCellProductPrices = async () => {
agreementPriceLoading.value = true
try {
const rows = await fetchAllPagedRecords(async (page, pageSize) => {
const data: any = await fetchCellProductPriceList({ page, pageSize })
return {
list: data?.list ?? [],
total: data?.total ?? 0
}
})
agreementPriceOptions.value = normalizeCellProductPriceRows(rows)
if (!agreementPriceOptions.value.length) {
ElMessage.warning('细胞价格体系暂无数据,请先在「细胞产品基础信息」中维护价格')
}
} catch {
agreementPriceOptions.value = []
} finally {
agreementPriceLoading.value = false
}
}
// 疗程数变化 → 自动增减输注计划 + 自动计算输注时间
const computeScheduleTime = (index: number): string => {
if (!infusionPlan.infusionStartDate || !infusionPlan.courseInterval) return ''
@@ -1860,6 +1924,9 @@
loadChannels()
loadInfusionMethodOptions()
remoteSearchCustomers('')
if (isClinical.value) {
loadClinicalCellProductPrices()
}
if (isEdit.value && props.editId) {
loadEditData(props.editId)
}
@@ -2002,10 +2069,12 @@
}))
}))
}
if (formData.channelId) {
if (formData.channelId && !isClinical.value) {
await loadAgreements(formData.channelId)
}
if (!isClinical.value && formData.channelServiceOrderId) {
if (isClinical.value) {
await loadClinicalCellProductPrices()
} else if (formData.channelServiceOrderId) {
await onServiceOrderChange(formData.channelServiceOrderId, { preserveCellProducts: true })
} else if (infusionPlan.channelAgreementId) {
await onAgreementChange(infusionPlan.channelAgreementId)
@@ -2031,7 +2100,10 @@
try {
const payload: Record<string, any> = {
applicationName: formData.applicationName || undefined,
channelServiceOrderId: formData.channelServiceOrderId || undefined,
channelId: formData.channelId || undefined,
channelServiceOrderId: isClinical.value
? undefined
: formData.channelServiceOrderId || undefined,
remark: formData.remark || undefined,
bizType: props.bizType || undefined,
patient: {
@@ -2049,7 +2121,7 @@
.map((f) => f.fileUrl)
.filter(Boolean)
.join(',') || undefined,
needCheckup: patientForm.needCheckup
needCheckup: isClinical.value ? 0 : patientForm.needCheckup
},
infusionPlan: {
id: infusionPlan.id || undefined,
@@ -2154,6 +2226,10 @@
grid-column: span 2;
}
.clinical-application-remark {
grid-column: span 2;
}
:deep(.el-form-item) {
margin-bottom: 0;
}