@@ -541,11 +541,14 @@ function getListInfo(addNewRow) {
loadingInstance . close ( ) ;
prescriptionList . value = res . data
. map ( ( item ) => {
const parsedContent = JSON . parse ( item . contentJson ) ;
return {
... JSON . parse ( item . contentJson ) ,
... parsedContent ,
... item ,
doseQuantity : JSON . parse ( item . contentJson ) ? . doseQuantity ,
doseUnitCode _dictText : JSON . parse ( item . contentJson ) ? . doseUnitCode _dictText ,
doseQuantity : parsedContent ? . doseQuantity ,
doseUnitCode _dictText : parsedContent ? . doseUnitCode _dictText ,
// 确保 therapyEnum 被正确设置,优先使用 contentJson 中的值
therapyEnum : String ( parsedContent ? . therapyEnum ? ? item . therapyEnum ? ? '1' ) ,
} ;
} )
. sort ( ( a , b ) => {
@@ -604,7 +607,7 @@ function handleAddPrescription() {
showPopover : false ,
isEdit : true ,
statusEnum : 1 ,
therapyEnum : '1' ,
therapyEnum : '1' , // 默认为长期医嘱
} ) ;
getGroupMarkers ( ) ;
nextTick ( ( ) => {
@@ -641,8 +644,8 @@ function clickRowDb(row, column, event) {
}
row . showPopover = false ;
if ( row . statusEnum == 1 ) {
// 确保治疗类型为字符串,方便与单选框 label 对齐
row . therapyEnum = String ( row . therapyEnum ? ? '' ) ;
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
row . therapyEnum = String ( row . therapyEnum ? ? '1 ' ) ;
row . isEdit = true ;
const index = prescriptionList . value . findIndex ( ( item ) => item . uniqueKey === row . uniqueKey ) ;
prescriptionList . value [ index ] = row ;
@@ -879,13 +882,16 @@ function handleSave() {
// 此处签发处方和单行保存处方传参相同, 后台已经将传参存为JSON字符串, 此处直接转换为JSON即可
loading . value = true ;
let list = saveList . map ( ( item ) => {
const parsedContent = JSON . parse ( item . contentJson ) ;
return {
... JSON . parse ( item . contentJson ) ,
... parsedContent ,
adviceType : item . adviceType ,
requestId : item . requestId ,
dbOpType : '1' ,
groupId : item . groupId ,
uniqueKey : undefined ,
// 确保 therapyEnum 被正确传递
therapyEnum : parsedContent . therapyEnum || item . therapyEnum || '1' ,
} ;
} ) ;
// 保存签发按钮
@@ -1059,6 +1065,8 @@ function handleSaveSign(row, index) {
row . conditionDefinitionId = conditionDefinitionId . value ;
row . encounterDiagnosisId = encounterDiagnosisId . value ;
row . diagnosisName = diagnosisName . value ;
// 确保 therapyEnum 被正确设置,默认为长期医嘱('1')
row . therapyEnum = row . therapyEnum || '1' ;
if ( row . injectFlag == 1 ) {
row . sortNumber = row . sortNumber ? row . sortNumber : prescriptionList . value . length ;
}
@@ -1098,8 +1106,11 @@ function handleSaveBatch() {
return item . statusEnum == 1 && ! item . requestId ;
} )
. map ( ( item ) => {
// 确保 therapyEnum 被正确传递,默认为长期医嘱('1')
const therapyEnum = item . therapyEnum || '1' ;
return {
... item ,
therapyEnum : therapyEnum ,
dbOpType : item . requestId ? '2' : '1' ,
} ;
} ) ;
@@ -1246,6 +1257,8 @@ function handleSaveGroup(orderGroupList) {
conditionId : conditionId . value , // 诊断id
conditionDefinitionId : conditionDefinitionId . value , // 诊断定义id
encounterDiagnosisId : encounterDiagnosisId . value , // 就诊诊断id
// 确保 therapyEnum 被正确设置,默认为长期医嘱('1')
therapyEnum : prescriptionList . value [ rowIndex . value ] ? . therapyEnum || '1' ,
} ;
// 计算价格和总量
@@ -1278,7 +1291,12 @@ function handleSaveHistory(value) {
conditionId : conditionId . value ,
conditionDefinitionId : conditionDefinitionId . value ,
encounterDiagnosisId : encounterDiagnosisId . value ,
contentJson : JSON . stringify ( value ) ,
// 确保 therapyEnum 被正确传递,默认为长期医嘱('1')
therapyEnum : value . therapyEnum || '1' ,
contentJson : JSON . stringify ( {
... value ,
therapyEnum : value . therapyEnum || '1' ,
} ) ,
} ;
savePrescription ( { adviceSaveList : [ saveRow ] , regAdviceSaveList : [ saveRow ] } ) . then ( ( res ) => {
if ( res . code === 200 ) {