Fix Bug #523: [住院医生站-临床医嘱] 修复待保存医嘱总金额显示缺失及编辑态单位选择框类型异常
根因:setValue() 中药品分支未初始化 totalPrice;unitCode/minUnitCode 未转 String 导致 el-select 类型不匹配 修复:选药后立即计算 totalPrice;所有单位值统一 String() 转换 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1441,14 +1441,14 @@ function handleSaveBatch() {
|
||||
function setValue(row) {
|
||||
// 构造单位列表
|
||||
unitCodeList.value = [
|
||||
{ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' },
|
||||
{ value: String(row.unitCode), label: row.unitCode_dictText, type: 'unit' },
|
||||
{
|
||||
value: row.doseUnitCode,
|
||||
value: String(row.doseUnitCode),
|
||||
label: row.doseUnitCode_dictText,
|
||||
type: 'dose',
|
||||
},
|
||||
{
|
||||
value: row.minUnitCode,
|
||||
value: String(row.minUnitCode),
|
||||
label: row.minUnitCode_dictText,
|
||||
type: 'minUnit',
|
||||
},
|
||||
@@ -1514,8 +1514,8 @@ function setValue(row) {
|
||||
// dose: undefined, Removed to preserve dose value from group package
|
||||
unitCodeList: unitCodeList.value,
|
||||
doseUnitCode: row.doseUnitCode,
|
||||
minUnitCode: row.minUnitCode,
|
||||
unitCode: row.partAttributeEnum == 1 ? row.minUnitCode : row.unitCode,
|
||||
minUnitCode: String(row.minUnitCode),
|
||||
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode) : String(row.unitCode),
|
||||
categoryEnum: row.categoryCode,
|
||||
definitionId: row.chargeItemDefinitionId,
|
||||
executeNum: 1,
|
||||
@@ -1531,6 +1531,13 @@ function setValue(row) {
|
||||
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
||||
: prevRow.minUnitPrice,
|
||||
positionName: selectedStock?.locationName,
|
||||
totalPrice: row.quantity
|
||||
? (String(row.unitCode) == String(row.minUnitCode)
|
||||
? (row.quantity * (selectedStock
|
||||
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
||||
: prevRow.minUnitPrice)).toFixed(6)
|
||||
: (row.quantity * (selectedStock?.price ?? 0)).toFixed(6))
|
||||
: undefined,
|
||||
}
|
||||
: {
|
||||
quantity: 1,
|
||||
|
||||
Reference in New Issue
Block a user