fix(charge): 修复收费模块中的数值计算和空指针异常问题

- 修复金额计算精度问题,使用Number转换和toFixed(2)确保数值准确性
- 添加安全访问操作符(?.)避免空指针异常导致页面崩溃
- 修复数组过滤和查找操作的空值处理逻辑
- 优化错误消息显示,提供更友好的用户提示
- 修复模板文件路径引用问题,确保打印功能正常工作
- 统一金额计算逻辑,避免因数据类型不一致导致的计算错误
This commit is contained in:
2026-01-13 17:30:17 +08:00
parent 0f013715b8
commit f5f4e3c48e
10 changed files with 719 additions and 43 deletions

View File

@@ -528,7 +528,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) + ' 元';
})(),
Mr_QR_Code: param.regNo,

View File

@@ -287,7 +287,7 @@ function getPatientList() {
queryParams.value.receptionTimeETime = undefined;
}
getList(queryParams.value).then((res) => {
patientList.value = res.data.data.records;
patientList.value = res.data?.data?.records || [];
});
}
@@ -363,17 +363,17 @@ function confirmCharge() {
encounterId: patientInfo.value.encounterId,
chargeItemIds: chargeItemIdList.value,
}).then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data) {
// totalAmount.value = res.data.psnCashPay;
paymentId.value = res.data.paymentId;
chrgBchnoList.value = res.data.chrgBchnoList;
totalAmount.value = res.data.details.find((item) => item.payEnum == 220000).amount;
details.value = res.data.details.filter((item) => {
totalAmount.value = res.data.details?.find((item) => item.payEnum == 220000)?.amount ?? 0;
details.value = res.data.details?.filter((item) => {
return item.amount > 0;
});
}) || [];
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
proxy.$modal.msgError(res?.msg || '预结算失败');
}
});
// console.log(patientInfo)
@@ -517,11 +517,11 @@ async function handleReadCard(value) {
ybMdtrtCertType: userCardInfo.psnCertType,
busiCardInfo: userCardInfo.busiCardInfo,
}).then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data) {
// totalAmount.value = res.data.psnCashPay;
paymentId.value = res.data.paymentId;
totalAmount.value = res.data.details.find((item) => item.payEnum == 220000).amount;
details.value = res.data.details;
totalAmount.value = res.data.details?.find((item) => item.payEnum == 220000)?.amount ?? 0;
details.value = res.data.details || [];
// chrgBchnoList.value = res.data.chrgBchnoList;
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
@@ -537,7 +537,7 @@ async function handleReadCard(value) {
});
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
proxy.$modal.msgError(res?.msg || '预结算失败');
}
});
}
@@ -648,9 +648,9 @@ function printCharge(row) {
getChargeInfo({ paymentId: row.paymentId }).then((res) => {
// 设置实收金额
if (res.data && res.data.detail) {
const amountDetail = res.data.detail.find((item) => item.payEnum == 220000);
const amountDetail = res.data.detail?.find((item) => item.payEnum == 220000);
if (amountDetail) {
totalAmount.value = amountDetail.amount;
totalAmount.value = amountDetail.amount || 0;
// 为合并的行设置金额相关字段值
rows.forEach((item) => {

View File

@@ -302,14 +302,14 @@ function handleRefund(row) {
// return new Decimal(accumulator).add(new Decimal(currentRow.totalPrice || 0));
// }, 0);
getReturnDetail({ id: row.paymentId }).then((res) => {
if (res.data.length > 0) {
if (res.data?.length > 0) {
totalAmount.value =
res.data.find((item) => item.payEnum === 220000).amount -
(res.data.find((item) => item.payEnum === 220500)?.amount || 0);
(res.data.find((item) => item.payEnum === 220000)?.amount ?? 0) -
(res.data.find((item) => item.payEnum === 220500)?.amount ?? 0);
}
details.value = res.data.filter((item) => {
details.value = res.data?.filter((item) => {
return item.amount > 0;
});
}) || [];
});
paymentId.value = row.paymentId;
patientInfo.value.patientId = row.patientId;

View File

@@ -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) + '元';
})(),
// 患者信息

View File

@@ -196,7 +196,7 @@ watch(
// 计算应退金额并更新表单数据
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
const sum = res.data
.filter((item) => targetPayEnums.includes(item.payEnum))
?.filter((item) => targetPayEnums.includes(item.payEnum))
.reduce((total, item) => total + (Number(item.amount) || 0), 0);
if (sum > 0) {
formData.totalAmount = sum;
@@ -313,9 +313,9 @@ const displayAmount = computed(() => {
}
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
const sum = preCancelData.value
.filter((item) => targetPayEnums.includes(item.payEnum))
?.filter((item) => targetPayEnums.includes(item.payEnum))
.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
return sum.toFixed(2);
return sum?.toFixed(2) ?? '0.00';
});
const returnedAmount = computed(() => {
@@ -334,7 +334,7 @@ const calculatedTotalAmount = computed(() => {
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
// 应退金额 = (amount - returnAmount) 的总和,即剩余应退金额
const sum = preCancelData.value
.filter((item) => targetPayEnums.includes(item.payEnum))
?.filter((item) => targetPayEnums.includes(item.payEnum))
.reduce(
(total, item) => total + ((Number(item.amount) || 0) - (Number(item.returnAmount) || 0)),
0
@@ -348,7 +348,7 @@ const calculatedReturnAmount = computed(() => {
}
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
const sum = preCancelData.value
.filter((item) => targetPayEnums.includes(item.payEnum))
?.filter((item) => targetPayEnums.includes(item.payEnum))
.reduce((total, item) => total + (Number(item.returnAmount) || 0), 0);
return sum || 0;
});
@@ -359,12 +359,12 @@ const refundMethodsFromApi = computed(() => {
return [];
}
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
return preCancelData.value.filter(
return preCancelData.value?.filter(
(item) =>
targetPayEnums.includes(item.payEnum) &&
item.payEnum_dictText &&
item.payEnum_dictText.trim() !== ''
);
) || [];
});
// 根据 payEnum 获取支付方式标签
@@ -380,7 +380,7 @@ const getPayMethodLabel = (payEnum) => {
// 计算所有退费方式的总和
const totalRefundAmount = computed(() => {
return refundMethodsFromApi.value.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
return refundMethodsFromApi.value?.reduce((sum, item) => sum + (Number(item.amount) || 0), 0) ?? 0;
});
// 计算剩余可输入金额(应退金额 - 已输入的退费金额总和)

View File

@@ -801,10 +801,10 @@ const { queryParams, form, rules } = toRefs(data);
/** 根据contractNo获取费用性质名称 */
function getFeeTypeName(contractNo) {
if (!contractNo || !medfee_paymtd_code || !Array.isArray(medfee_paymtd_code)) {
if (!contractNo || !medfee_paymtd_code?.value || !Array.isArray(medfee_paymtd_code.value)) {
return '';
}
const dictItem = medfee_paymtd_code.find(item => item.value === contractNo);
const dictItem = medfee_paymtd_code.value.find(item => item.value === contractNo);
return dictItem ? dictItem.label : '';
}
@@ -1185,7 +1185,7 @@ function filterDoctorsByHealthcare() {
}
// 获取选中的挂号类型信息
const selectedHealthcare = healthcareList.value.find(
const selectedHealthcare = healthcareList.value?.find(
(healthcare) => healthcare.id === form.value.serviceTypeId
);

View File

@@ -291,8 +291,8 @@ import {advicePrint, getAdjustPriceSwitchState, lotNumberMatch} from '@/api/publ
import {debounce} from 'lodash-es';
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
import {hiprint} from 'vue-plugin-hiprint';
import templateJson from './components/templateJson.json';
import disposalTemplate from './components/disposalTemplate.json';
import templateJson from './templateJson.json';
import disposalTemplate from './disposalTemplate.json';
import {formatInventory} from '@/utils/his.js';
import useUserStore from '@/store/modules/user';

View File

@@ -0,0 +1,337 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "A5",
"height": 210,
"width": 148,
"paperHeader": 0,
"paperFooter": 592.4409448818898,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"expandCss": "",
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "14px",
"rotate": 25,
"width": 200,
"height": 200,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {},
"printElements": [
{
"options": {
"left": 0,
"top": 22.5,
"height": 12,
"width": 420,
"title": "{{HOSPITAL_NAME}}",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 13.5,
"qrCodeLevel": 0,
"textAlign": "center"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 0,
"top": 45,
"height": 9.75,
"width": 420,
"title": "处置单",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 11.25,
"qrCodeLevel": 0,
"textAlign": "center"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 22.5,
"top": 67.5,
"height": 9.75,
"width": 120,
"title": "姓名",
"field": "patientName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 157.5,
"top": 67.5,
"height": 9.75,
"width": 120,
"title": "年龄",
"field": "age",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 300,
"top": 67.5,
"height": 9.75,
"width": 120,
"title": "性别",
"field": "genderEnum_enumText",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 22.5,
"top": 94.5,
"height": 9.75,
"width": 96,
"title": "科室",
"field": "departmentName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 156,
"top": 94.5,
"height": 9.75,
"width": 118.5,
"title": "费用性质",
"field": "contractName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 300,
"top": 94.5,
"height": 9.75,
"width": 120,
"title": "日期",
"field": "reqTime",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 22.5,
"top": 121.5,
"height": 9.75,
"width": 123,
"title": "门诊号",
"field": "encounterNo",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 156,
"top": 121.5,
"height": 9.75,
"width": 120,
"title": "开单医生",
"field": "doctorName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 18,
"top": 141,
"height": 9,
"width": 393,
"borderWidth": "1.5",
"title": "undefined+beforeDragIn",
"coordinateSync": false,
"widthHeightSync": false
},
"printElementType": {
"title": "横线",
"type": "hline"
}
},
{
"options": {
"left": 22.5,
"top": 156,
"height": 9.75,
"width": 24,
"title": "Rp",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 12,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 22.5,
"top": 177,
"height": 36,
"width": 387,
"title": "undefined+beforeDragIn",
"coordinateSync": false,
"widthHeightSync": false,
"field": "adviceItemList",
"columns": [
[
{
"title": "项目名",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 180.11284430829235,
"field": "itemName",
"checked": true,
"columnId": "itemName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "单价",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 65.15543233883191,
"field": "unitPrice",
"checked": true,
"columnId": "unitPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "数量",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' ' + row.unitCode_dictText; }",
"width": 61.720533008519084,
"field": "quantity",
"checked": true,
"columnId": "quantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "执行次数",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 80.01119034435662,
"field": "quantity",
"checked": true,
"columnId": "quantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
}
]
]
},
"printElementType": {
"title": "表格",
"type": "table",
"editable": true,
"columnDisplayEditable": true,
"columnDisplayIndexEditable": true,
"columnTitleEditable": true,
"columnResizable": true,
"columnAlignEditable": true,
"isEnableEditField": true,
"isEnableContextMenu": true,
"isEnableInsertRow": true,
"isEnableDeleteRow": true,
"isEnableInsertColumn": true,
"isEnableDeleteColumn": true,
"isEnableMergeCell": true
}
}
]
}
]
}

View File

@@ -0,0 +1,339 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 130,
"width": 210,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "14px",
"rotate": 25,
"width": 200,
"height": 200,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {},
"paperHeader": 0,
"paperFooter": 841.8897637795277,
"printElements": [
{
"options": {
"left": 252,
"top": 13.5,
"height": 12,
"width": 75,
"title": "{{HOSPITAL_NAME}}医院",
"coordinateSync": false,
"widthHeightSync": false,
"fontSize": 12,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 33,
"height": 9.75,
"width": 120,
"title": "日期",
"field": "occurrenceTime",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 222,
"top": 33,
"height": 9.75,
"width": 120,
"title": "单据号",
"field": "busNo",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 465,
"top": 33,
"height": 9.75,
"width": 120,
"title": "机构:{{HOSPITAL_NAME}}医院",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 57,
"height": 9.75,
"width": 322.5,
"title": "供应商",
"field": "supplierName",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 19.5,
"top": 84,
"height": 36,
"width": 570,
"title": "undefined+beforeDragIn",
"field": "purchaseinventoryList",
"coordinateSync": false,
"widthHeightSync": false,
"columns": [
[
{
"title": "项目名",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 53.52877835374887,
"field": "name",
"checked": true,
"columnId": "name",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "规格",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 50.3056193642802,
"field": "volume",
"checked": true,
"columnId": "volume",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "厂家/产地",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 84.09807741407441,
"field": "manufacturerText",
"checked": true,
"columnId": "manufacturerText",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "数量",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' ' + row.unitCode_dictText; }",
"width": 37.02194283284556,
"field": "itemQuantity",
"checked": true,
"columnId": "itemQuantity",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "采购单价",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 45.05495152300426,
"field": "price",
"checked": true,
"columnId": "price",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "金额",
"titleSync": false,
"align": "right",
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
"width": 39.04544357631049,
"field": "totalPrice",
"checked": true,
"columnId": "totalPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "仓库",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 40.041954542099724,
"field": "purposeLocationName",
"checked": true,
"columnId": "purposeLocationName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "产品批号",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 47.05067091842349,
"field": "lotNumber",
"checked": true,
"columnId": "lotNumber",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "生产日期",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 63.089377997062755,
"field": "startTime",
"checked": true,
"columnId": "startTime",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "有效期至",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 59.05673483929025,
"field": "endTime",
"checked": true,
"columnId": "endTime",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "发票号",
"titleSync": false,
"halign": "center",
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 51.706448638859854,
"field": "invoiceNo",
"checked": true,
"columnId": "invoiceNo",
"fixed": false,
"rowspan": 1,
"colspan": 1
}
]
]
},
"printElementType": {
"title": "表格",
"type": "table",
"editable": true,
"columnDisplayEditable": true,
"columnDisplayIndexEditable": true,
"columnTitleEditable": true,
"columnResizable": true,
"columnAlignEditable": true,
"isEnableEditField": true,
"isEnableContextMenu": true,
"isEnableInsertRow": true,
"isEnableDeleteRow": true,
"isEnableInsertColumn": true,
"isEnableDeleteColumn": true,
"isEnableMergeCell": true
}
},
{
"options": {
"left": 480,
"top": 130.5,
"height": 12,
"width": 109.5,
"title": "合计",
"field": "totalAmount",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value + ' 元'\n}"
},
"printElementType": {
"title": "文本",
"type": "text"
}
}
]
}
]
}

View File

@@ -498,21 +498,21 @@ function confirmCharge() {
encounterId: patientInfo.value.encounterId,
chargeItemIds: chargeItemIdList.value,
}).then((res) => {
if (res.code == 200) {
const item = res.data.paymentRecDetailDtoList.find((i) => {
if (res.code == 200 && res.data) {
const item = res.data.paymentRecDetailDtoList?.find((i) => {
return i.payEnum == 220000;
});
totalAmount.value = item?.amount;
totalAmount.value = item?.amount ?? 0;
paymentId.value = res.data.id;
newId.value = res.data.newId;
oldId.value = res.data.oldId;
chrgBchnoList.value = res.data.chrgBchnoList;
details.value = res.data.paymentRecDetailDtoList?.filter((item) => {
return item.amount > 0;
});
}) || [];
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
proxy.$modal.msgError(res?.msg || '预结算失败');
}
});
// console.log(patientInfo)
@@ -656,12 +656,12 @@ async function handleReadCard(value) {
ybMdtrtCertType: userCardInfo.psnCertType,
busiCardInfo: userCardInfo.busiCardInfo,
}).then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data) {
paymentId.value = res.data.id;
totalAmount.value = res.data.paymentRecDetailDtoList.find(
totalAmount.value = res.data.paymentRecDetailDtoList?.find(
(item) => item.payEnum == 220000
).amount;
details.value = res.data.paymentRecDetailDtoList;
)?.amount ?? 0;
details.value = res.data.paymentRecDetailDtoList || [];
// chrgBchnoList.value = res.data.chrgBchnoList;
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
@@ -680,7 +680,7 @@ async function handleReadCard(value) {
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
proxy.$modal.msgError(res?.msg || '预结算失败');
}
});
}