修复手术删除临时医嘱删除问题
This commit is contained in:
@@ -1386,12 +1386,46 @@ function handleMedicalAdvice(row) {
|
||||
// 如果没有数据或接口调用失败,初始化空列表
|
||||
temporaryBillingMedicines.value = []
|
||||
}
|
||||
|
||||
// 将计费药品转换为临时医嘱数据
|
||||
temporaryAdvices.value = temporaryBillingMedicines.value.map((medicine, index) => {
|
||||
// 解析规格中的数值和单位
|
||||
const specMatch = medicine.specification ? medicine.specification.match(/(\d+)(\D+)/) : null
|
||||
const specValue = specMatch ? parseInt(specMatch[1]) : 1
|
||||
const specUnit = specMatch ? specMatch[2] : 'ml'
|
||||
|
||||
// 计算剂量 = 规格数值 × 数量
|
||||
const dosage = specValue * (medicine.quantity || 1)
|
||||
|
||||
// 根据药品名称判断用法
|
||||
let usage = '静脉注射'
|
||||
if (medicine.medicineName && medicine.medicineName.includes('注射液')) {
|
||||
usage = '静脉注射'
|
||||
} else if (medicine.medicineName && medicine.medicineName.includes('片')) {
|
||||
usage = '口服'
|
||||
} else if (medicine.medicineName && medicine.medicineName.includes('胶囊')) {
|
||||
usage = '口服'
|
||||
}
|
||||
|
||||
return {
|
||||
id: index + 1,
|
||||
adviceName: medicine.medicineName || '',
|
||||
dosage: dosage,
|
||||
unit: specUnit,
|
||||
usage: usage,
|
||||
frequency: '临时',
|
||||
executeTime: new Date().toLocaleString('zh-CN'),
|
||||
originalMedicine: medicine
|
||||
}
|
||||
})
|
||||
|
||||
// 打开临时医嘱弹窗
|
||||
showTemporaryMedical.value = true
|
||||
}).catch(() => {
|
||||
temporaryBillingMedicines.value = []
|
||||
temporaryAdvices.value = []
|
||||
showTemporaryMedical.value = true
|
||||
})
|
||||
|
||||
// 打开临时医嘱弹窗
|
||||
showTemporaryMedical.value = true
|
||||
}
|
||||
|
||||
// 关闭临时医嘱弹窗
|
||||
|
||||
Reference in New Issue
Block a user