Fix Bug #466: [住院医生工作站-检验申请] 申请单界面缺失核心质控字段(申请类型、标本类型、执行时间)及联动逻辑
根因分析:前端表单已包含申请类型、标本类型、执行时间三个字段,但缺少标本类型联动逻辑。 当医生选择检验项目时,系统应根据所选项目的 sampleType 自动带出标本类型,而非始终显示硬编码默认值"血液"。 修复内容: - 在 selectedInspectionItems watch 中新增标本类型自动带出逻辑:当标本类型为空或仍为初始化默认值"血液"时,根据第一个检验项目的 sampleType 自动设置 - 当检验项目被清空时,同时清空标本类型(下次选择时会重新自动设置) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2063,15 +2063,20 @@ watch(() => props.patientInfo, async (newVal) => {
|
|||||||
}
|
}
|
||||||
}, { deep: true, immediate: true })
|
}, { deep: true, immediate: true })
|
||||||
|
|
||||||
// Bug #329: 监听已选择的检验项目,自动更新检验项目文本并设置默认执行科室
|
// Bug #329/#466: 监听已选择的检验项目,自动更新检验项目文本并设置默认执行科室、标本类型
|
||||||
watch(() => selectedInspectionItems.value, async (newVal) => {
|
watch(() => selectedInspectionItems.value, async (newVal) => {
|
||||||
if (newVal && newVal.length > 0) {
|
if (newVal && newVal.length > 0) {
|
||||||
formData.inspectionItemsText = newVal.map(item => item.itemName).join('+')
|
formData.inspectionItemsText = newVal.map(item => item.itemName).join('+')
|
||||||
|
|
||||||
// Bug #329: 如果执行科室为空,根据第一个检验项目的检验类型自动设置默认执行科室
|
|
||||||
if (!formData.executeDepartment) {
|
|
||||||
const firstItem = newVal[0]
|
const firstItem = newVal[0]
|
||||||
|
|
||||||
|
// Bug #466: 如果标本类型为空或仍为初始化默认值,根据第一个检验项目的 sampleType 自动设置默认标本类型
|
||||||
|
if ((!formData.specimenName || formData.specimenName === '血液') && firstItem.sampleType) {
|
||||||
|
formData.specimenName = firstItem.sampleType
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bug #329: 如果执行科室为空,根据第一个检验项目的检验类型自动设置默认执行科室
|
||||||
|
if (!formData.executeDepartment) {
|
||||||
// 根据检验项目的 inspectionTypeId 获取默认执行科室
|
// 根据检验项目的 inspectionTypeId 获取默认执行科室
|
||||||
if (firstItem.inspectionTypeId) {
|
if (firstItem.inspectionTypeId) {
|
||||||
const defaultDeptCode = await getDefaultPerformDeptCode(firstItem.inspectionTypeId)
|
const defaultDeptCode = await getDefaultPerformDeptCode(firstItem.inspectionTypeId)
|
||||||
@@ -2081,9 +2086,10 @@ watch(() => selectedInspectionItems.value, async (newVal) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Bug #329: 当项目被清空时,同时清空执行科室(下次选择项目时会重新自动设置)
|
// Bug #329: 当项目被清空时,同时清空执行科室和标本类型(下次选择项目时会重新自动设置)
|
||||||
formData.inspectionItemsText = ''
|
formData.inspectionItemsText = ''
|
||||||
formData.executeDepartment = ''
|
formData.executeDepartment = ''
|
||||||
|
formData.specimenName = ''
|
||||||
}
|
}
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user