Fix Bug #456: 门诊医生站:诊疗类医嘱保存后类型变更为"检查"且签发成功后状态未更新

根因:前端setValue中将row.categoryCode(文本值如"检查")赋给categoryEnum(Integer字段),
导致后端Jackson反序列化失败,category_enum存储异常。
修复:将row.categoryCode改为row.activityType(数值1=检验,2=检查,3=护理,4=手术,5=其他)。
This commit is contained in:
刘备
2026-05-09 17:55:16 +08:00
parent 57cdeef910
commit d3b6030693

View File

@@ -3410,7 +3410,7 @@ function setValue(row) {
// 🔧 Bug Fix #456: 诊疗类医嘱(adviceType=3)不应将categoryCode赋值给categoryEnum
// 否则保存后SQL查询会根据category_enum=2(检查目录)将类型误判为"检查"
if (row.adviceType != 3) {
prescriptionList.value[rowIndex.value].categoryEnum = row.categoryCode;
prescriptionList.value[rowIndex.value].categoryEnum = row.activityType;
}
prescriptionList.value[rowIndex.value].skinTestFlag = row.skinTestFlag;
prescriptionList.value[rowIndex.value].definitionId = row.chargeItemDefinitionId;
@@ -3482,7 +3482,7 @@ function setValue(row) {
// 🔧 Bug Fix: 设置耗材的minUnitQuantity避免保存时null错误
prescriptionList.value[rowIndex.value].minUnitQuantity = row.quantity || 1;
// 🔧 Bug Fix: 设置耗材的categoryEnum避免数据库约束错误
prescriptionList.value[rowIndex.value].categoryEnum = row.categoryCode || 3; // 默认为3
prescriptionList.value[rowIndex.value].categoryEnum = row.activityType || 3; // 默认为3
prescriptionList.value[rowIndex.value].positionName = row.positionName || '';
// 🔧 Bug Fix: 使用 positionId如果为空则使用患者信息中的 orgId
console.log('设置耗材locationId:', {
@@ -3504,7 +3504,7 @@ function setValue(row) {
// 🔧 Bug Fix: 设置耗材的minUnitQuantity避免保存时null错误
prescriptionList.value[rowIndex.value].minUnitQuantity = row.quantity || 1;
// 🔧 Bug Fix: 设置耗材的categoryEnum避免数据库约束错误
prescriptionList.value[rowIndex.value].categoryEnum = row.categoryCode || 3; // 默认为3
prescriptionList.value[rowIndex.value].categoryEnum = row.activityType || 3; // 默认为3
prescriptionList.value[rowIndex.value].positionName = row.positionName || '';
const finalLocationId = row.positionId || props.patientInfo.orgId;
prescriptionList.value[rowIndex.value].locationId = finalLocationId;