fix(charge): 修复医保支付金额计算的安全访问问题

- 在 cliniccharge 组件中为所有金额查询添加可选链操作符防止空指针异常
- 在住院管理收费结算组件中修复金额格式化导致的显示问题
- 统一处理患者信息字段的空值情况避免页面渲染错误
- 修正金额计算逻辑确保数值精度和显示准确性
This commit is contained in:
2026-01-13 17:02:27 +08:00
parent f2b5b90f34
commit 6f9192d30d
2 changed files with 71 additions and 71 deletions

View File

@@ -260,17 +260,17 @@ function printReceipt(param) {
...param,
// 基础支付类型
YB_FUND_PAY:
param.detail?.find((t) => t.payEnum === 100000)?.amount.toFixed(2) + ' 元' ?? 0, // 基金支付总额
SELF_PAY: param.detail?.find((t) => t.payEnum === 200000)?.amount.toFixed(2) + ' 元' ?? 0, // 个人负担总金额
(param.detail?.find((t) => t.payEnum === 100000)?.amount?.toFixed(2) || '0.00') + ' 元',
SELF_PAY: (param.detail?.find((t) => t.payEnum === 200000)?.amount?.toFixed(2) || '0.00') + ' 元',
OTHER_PAY: param.detail?.find((t) => t.payEnum === 300000)?.amount ?? 0, // 其他(如医院负担金额)
// 基本医保统筹基金支出
YB_TC_FUND_AMOUNT:
param.detail?.find((t) => t.payEnum === 110000)?.amount.toFixed(2) + ' 元' ?? 0, // 基本医保统筹基金支出
(param.detail?.find((t) => t.payEnum === 110000)?.amount?.toFixed(2) || '0.00') + ' 元',
YB_BC_FUND_AMOUNT:
param.detail?.find((t) => t.payEnum === 120000)?.amount.toFixed(2) + ' 元' ?? 0, // 补充医疗保险基金支出
(param.detail?.find((t) => t.payEnum === 120000)?.amount?.toFixed(2) || '0.00') + ' 元',
YB_JZ_FUND_AMOUNT:
param.detail?.find((t) => t.payEnum === 130000)?.amount.toFixed(2) + ' 元' ?? 0, // 医疗救助基金支出
(param.detail?.find((t) => t.payEnum === 130000)?.amount?.toFixed(2) || '0.00') + ' 元',
// YB_OTHER_AMOUNT: param.detail.find((t) => t.payEnum === 140000)?.amount ?? 0, // 其他支出
// 职工基本医疗保险
@@ -298,17 +298,17 @@ function printReceipt(param) {
// 医保结算返回值
FULAMT_OWNPAY_AMT:
param.detail?.find((t) => t.payEnum === 1)?.amount.toFixed(2) + ' 元' ?? 0, // 全自费金额
(param.detail?.find((t) => t.payEnum === 1)?.amount?.toFixed(2) || '0.00') + ' 元',
// OVERLMT_SELFPAY: param.detail.find((t) => t.payEnum === 3)?.amount ?? 0, // 超限价自费费用
// PRESELFPAY_AMT: param.detail.find((t) => t.payEnum === 4)?.amount ?? 0, // 先行自付金额
INSCP_SCP_AMT: param.detail?.find((t) => t.payEnum === 5)?.amount.toFixed(2) + ' 元' ?? 0, // 符合政策范围金额
INSCP_SCP_AMT: (param.detail?.find((t) => t.payEnum === 5)?.amount?.toFixed(2) || '0.00') + ' 元',
// ACT_PAY_DEDC: param.detail.find((t) => t.payEnum === 6)?.amount ?? 0, // 实际支付起付线
// POOL_PROP_SELFPAY: param.detail.find((t) => t.payEnum === 7)?.amount ?? 0, // 基本医疗保险统筹基金支付比例
// BALC: param.detail.find((t) => t.payEnum === 8)?.amount ?? 0, // 余额
// 特殊支付方式
SELF_YB_ZH_PAY:
param.detail?.find((t) => t.payEnum === 210000)?.amount.toFixed(2) + ' 元' ?? 0, // 个人医保账户支付
(param.detail?.find((t) => t.payEnum === 210000)?.amount?.toFixed(2) || '0.00') + ' 元',
// SELF_YB_ZH_GJ_VALUE: param.detail.find((t) => t.payEnum === 210100)?.amount ?? 0, // 账户共济支付金额
// SELF_CASH_PAY: param.detail.find((t) => t.payEnum === 220000)?.amount ?? 0, // 个人现金支付金额
// SELF_VX_PAY: param.detail.find((t) => t.payEnum === 230000)?.amount ?? 0, // 微信支付金额
@@ -334,14 +334,14 @@ function printReceipt(param) {
// SUPPLEMENTARY_INSURANCE: param.detail.find((t) => t.payEnum === 390300)?.amount ?? 0, // 城乡居民大病补充保险基金
// HEALTHCARE_PREPAYMENT: param.detail.find((t) => t.payEnum === 360300)?.amount ?? 0, // 保健预支基金
Mr_QR_Code: param.regNo,
sex: props.patientInfo.genderEnum_enumText,
age: props.patientInfo.age,
sex: props.patientInfo?.genderEnum_enumText || '',
age: props.patientInfo?.age || '',
personType: '职工医保',
fixmedinsName: param.fixmedinsName + '门诊收费明细',
name: props.patientInfo.patientName, // 姓名
gender: props.patientInfo.genderEnum_enumText, // 性别
age: props.patientInfo.age, // 年龄
encounterBusNo: props.patientInfo.encounterBusNo, // 病例号
fixmedinsName: (param.fixmedinsName || '') + '门诊收费明细',
name: props.patientInfo?.patientName || '', // 姓名
gender: props.patientInfo?.genderEnum_enumText || '', // 性别
age: props.patientInfo?.age || '', // 年龄
encounterBusNo: props.patientInfo?.encounterBusNo || '', // 病例号
currentDate: currentDate.value, // 收费日期
chargedItems: props.chargedItems, // 收费项目
totalAmount: props.totalAmount.toFixed(2) + ' 元', // 应收金额