fix(charge): 修复收费模块中的数值计算和空指针异常问题
- 修复金额计算精度问题,使用Number转换和toFixed(2)确保数值准确性 - 添加安全访问操作符(?.)避免空指针异常导致页面崩溃 - 修复数组过滤和查找操作的空值处理逻辑 - 优化错误消息显示,提供更友好的用户提示 - 修复模板文件路径引用问题,确保打印功能正常工作 - 统一金额计算逻辑,避免因数据类型不一致导致的计算错误
This commit is contained in:
@@ -128,7 +128,7 @@ const getFeeTypeText = computed(() => {
|
||||
}
|
||||
// 如果只有一个选项,直接返回第一个选项的文本
|
||||
if (props.medfee_paymtd_code.length === 1) {
|
||||
return props.medfee_paymtd_code[0].label || '';
|
||||
return props.medfee_paymtd_code[0]?.label || '';
|
||||
}
|
||||
return '';
|
||||
});
|
||||
@@ -351,7 +351,7 @@ async function printReceipt(param) {
|
||||
const vxValue = param.detail?.find((t) => t.payEnum === 220100)?.amount ?? 0;
|
||||
const unionValue = param.detail?.find((t) => t.payEnum === 220300)?.amount ?? 0;
|
||||
const aliValue = param.detail?.find((t) => t.payEnum === 220200)?.amount ?? 0;
|
||||
return vxValue + unionValue + aliValue + '元';
|
||||
return (Number(vxValue) + Number(unionValue) + Number(aliValue)).toFixed(2) + '元';
|
||||
})(),
|
||||
|
||||
// 患者信息
|
||||
|
||||
Reference in New Issue
Block a user