700 710 711 713 bug 修复

This commit is contained in:
Ranyunqiao
2026-06-12 10:40:39 +08:00
parent babd8d0c04
commit f407a2a886
6 changed files with 341 additions and 291 deletions

View File

@@ -150,10 +150,21 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
@Override @Override
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo, public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
Integer pageSize, String searchKey, HttpServletRequest request) { Integer pageSize, String searchKey, HttpServletRequest request) {
// 就诊ID集合
String encounterIds = dispenseFormSearchParam.getEncounterIds();
dispenseFormSearchParam.setEncounterIds(null);
// 构建查询条件 // 构建查询条件
QueryWrapper<DispenseFormSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam, QueryWrapper<DispenseFormSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam,
searchKey, new HashSet<>(List.of(CommonConstants.FieldName.BusNo)), request); searchKey, new HashSet<>(List.of(CommonConstants.FieldName.BusNo)), request);
// 如果传了就诊ID过滤关联的汇总单
if (StringUtils.isNotEmpty(encounterIds)) {
queryWrapper.inSql(CommonConstants.FieldName.BusNo,
"SELECT DISTINCT summary_no FROM med_medication_dispense " +
"WHERE encounter_id IN (" + encounterIds + ") AND summary_no IS NOT NULL");
}
// 汇总单分页列表 // 汇总单分页列表
Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage( Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage(
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(), new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(),

View File

@@ -3,33 +3,32 @@
{ {
"index": 0, "index": 0,
"name": 1, "name": 1,
"paperType": "自定义", "paperType": "A5",
"height": 80, "height": 148,
"width": 279, "width": 210,
"paperList": { "paperList": {
"type": "自定义", "type": "A5",
"width": 279, "width": 210,
"height": 80 "height": 148
}, },
"panelPageRule": "none",
"paperHeader": 0, "paperHeader": 0,
"paperFooter": 422.3622047244095, "paperFooter": 419.53,
"paperNumberDisabled": true, "paperNumberDisabled": true,
"paperNumberContinue": true, "paperNumberContinue": true,
"panelAngle": 0, "panelAngle": 0,
"overPrintOptions": { "overPrintOptions": {
"content": "", "content": "",
"opacity": 0.7, "opacity": 0.01,
"type": 1 "type": 1
}, },
"watermarkOptions": { "watermarkOptions": {
"content": "", "content": "",
"fillStyle": "rgba(87, 13, 248, 0.5)", "fillStyle": "rgba(87, 13, 248, 0.5)",
"fontSize": "36px", "fontSize": "10px",
"rotate": 25, "rotate": 0,
"width": 413, "width": 100,
"height": 310, "height": 100,
"timestamp": true, "timestamp": false,
"format": "YYYY-MM-DD HH:mm" "format": "YYYY-MM-DD HH:mm"
}, },
"panelLayoutOptions": { "panelLayoutOptions": {
@@ -40,238 +39,30 @@
"printElements": [ "printElements": [
{ {
"options": { "options": {
"left": 0, "left": 505.5,
"top": 15, "top": 20,
"height": 16.5, "height": 20,
"width": 792, "width": 60,
"title": "{{HOSPITAL_NAME}}预交金收据",
"coordinateSync": false,
"widthHeightSync": false,
"fontWeight": "bold",
"letterSpacing": 0.75,
"textAlign": "center",
"qrCodeLevel": 0,
"fontSize": 15,
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 111,
"top": 46.5,
"height": 14,
"width": 151.5,
"title": "姓名",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "patientName",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 295.5,
"top": 48,
"height": 14,
"width": 148.5,
"title": "住院号",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "encounterNosd",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 480,
"top": 48,
"height": 14,
"width": 162,
"title": "科室",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "inHospitalOrgName",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 111,
"top": 73.5,
"height": 14,
"width": 153,
"title": "ID号",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "patientId",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 295.5,
"top": 73.5,
"height": 14,
"width": 147,
"title": "医保类别",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "contractName",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 480,
"top": 73.5,
"height": 14,
"width": 163.5,
"title": "时间",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "currentTime",
"fontFamily": "Microsoft YaHei"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 111,
"top": 105,
"height": 25,
"width": 120,
"title": "金额",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"textContentVerticalAlign": "middle",
"borderLeft": "solid",
"borderTop": "solid",
"borderRight": "solid",
"borderBottom": "solid",
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 231,
"top": 105,
"height": 25,
"width": 393,
"title": "金额",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"textContentVerticalAlign": "middle",
"borderTop": "solid",
"borderRight": "solid",
"borderBottom": "solid",
"qrCodeLevel": 0,
"field": "balanceAmount",
"hideTitle": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 111,
"top": 129,
"height": 30,
"width": 120,
"title": "人民币(大写)",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"textContentVerticalAlign": "middle",
"borderLeft": "solid",
"borderTop": "solid",
"borderRight": "solid",
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 231,
"top": 129,
"height": 30,
"width": 393,
"title": "金额",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"textContentVerticalAlign": "middle",
"borderTop": "solid",
"borderRight": "solid",
"qrCodeLevel": 0,
"field": "amountInWords",
"hideTitle": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 111,
"top": 159,
"height": 30,
"width": 513,
"title": " ", "title": " ",
"field": "reprintTag",
"hideTitle": true,
"customClass": "reprint-tag",
"coordinateSync": false, "coordinateSync": false,
"widthHeightSync": false, "widthHeightSync": false,
"textAlign": "center", "textAlign": "center",
"textContentVerticalAlign": "middle", "textContentVerticalAlign": "middle",
"fontSize": 9,
"color": "#ff0000",
"fontWeight": "bold",
"borderLeft": "solid", "borderLeft": "solid",
"borderRight": "solid", "borderRight": "solid",
"borderTop": "solid",
"borderBottom": "solid", "borderBottom": "solid",
"borderColor": "#ff0000",
"borderWidth": 1.5,
"qrCodeLevel": 0, "qrCodeLevel": 0,
"field": "paymentDetails", "fixed": true,
"hideTitle": true "styler": "function(value, options, target, templateData, paperNo) { if (!value || value.trim() === '') { return { display: 'none' }; } return {}; }"
}, },
"printElementType": { "printElementType": {
"title": "文本", "title": "文本",
@@ -280,16 +71,20 @@
}, },
{ {
"options": { "options": {
"left": 111, "left": 30,
"top": 198, "top": 20,
"height": 14, "height": 30,
"width": 120, "width": 535.5,
"title": "签章", "title": "{{hospitalName}}",
"coordinateSync": false, "coordinateSync": false,
"widthHeightSync": false, "widthHeightSync": false,
"qrCodeLevel": 0, "textAlign": "center",
"field": "patientNamesfs", "fontWeight": "bold",
"fontFamily": "Microsoft YaHei" "fontSize": 19.5,
"fontFamily": "SimSun",
"letterSpacing": 5,
"color": "#000000",
"fixed": true
}, },
"printElementType": { "printElementType": {
"title": "文本", "title": "文本",
@@ -298,16 +93,20 @@
}, },
{ {
"options": { "options": {
"left": 297, "left": 30,
"top": 198, "top": 52,
"height": 14, "height": 20,
"width": 132, "width": 535.5,
"title": "交款人", "title": "住院预缴金收据(收执联)",
"coordinateSync": false, "coordinateSync": false,
"widthHeightSync": false, "widthHeightSync": false,
"qrCodeLevel": 0, "textAlign": "center",
"field": "patientNameada", "fontSize": 12,
"fontFamily": "Microsoft YaHei" "fontFamily": "SimSun",
"fontWeight": "normal",
"letterSpacing": 2,
"color": "#000000",
"fixed": true
}, },
"printElementType": { "printElementType": {
"title": "文本", "title": "文本",
@@ -316,16 +115,143 @@
}, },
{ {
"options": { "options": {
"left": 481.5, "left": 30,
"top": 198, "top": 78,
"height": 14, "height": 15,
"width": 124.5, "width": 250,
"title": "收款人", "title": "收据号:{{receiptNo}}",
"coordinateSync": false, "fontSize": 9,
"widthHeightSync": false, "color": "#000000",
"qrCodeLevel": 0, "fixed": true
"field": "cashier", },
"fontFamily": "Microsoft YaHei" "printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 288.35,
"top": 78,
"height": 15,
"width": 277.15,
"title": "收款日期:{{currentTime}}",
"textAlign": "right",
"fontSize": 9,
"color": "#000000",
"fixed": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 14.17,
"top": 96.38,
"width": 566.92,
"height": 185.0,
"title": "<table style='width:100%; border-collapse:collapse; border:1px solid #000000; table-layout:fixed; font-family:SimSun, serif; font-size:11px; color:#000000;'><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; width:65px; font-weight:bold; color:#000000;'>住院号</td><td style='border:1px solid #000; padding:0 4px; width:130px; white-space:normal; word-break:break-all; color:#000000;'>{{encounterNosd}}</td><td style='border:1px solid #000; background:#F5F5F5; text-align:center; width:50px; font-weight:bold; color:#000000;'>姓名</td><td style='border:1px solid #000; padding:0 4px; width:110px; white-space:normal; word-break:break-all; color:#000000;'>{{patientName}}</td><td style='border:1px solid #000; background:#F5F5F5; text-align:center; width:50px; font-weight:bold; color:#000000;'>性别</td><td style='border:1px solid #000; text-align:center; width:50px; white-space:normal; word-break:break-all; color:#000000;'>{{gender}}</td><td style='border:1px solid #000; background:#F5F5F5; text-align:center; width:60px; font-weight:bold; color:#000000;'>年龄</td><td style='border:1px solid #000; text-align:center; width:51.92px; white-space:normal; word-break:break-all; color:#000000;'>{{age}}</td></tr><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>病区/科室</td><td style='border:1px solid #000; padding:0 4px; white-space:normal; word-break:break-all; color:#000000;' colspan='3'>{{inHospitalOrgName}}</td><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>床号</td><td style='border:1px solid #000; text-align:center; white-space:normal; word-break:break-all; color:#000000;'>{{bedName}}</td><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>医保类型</td><td style='border:1px solid #000; text-align:center; white-space:normal; word-break:break-all; color:#000000;'>{{contractName}}</td></tr><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>收费项目</td><td style='border:1px solid #000; padding:0 4px; white-space:normal; word-break:break-all; color:#000000;' colspan='7'>住院预缴款</td></tr><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>支付方式</td><td style='border:1px solid #000; padding:0 4px; white-space:normal; word-break:break-all; color:#000000;' colspan='7'>{{paymentMethod}}</td></tr><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>金额(大写)</td><td style='border:1px solid #000; padding:0 4px; font-weight:normal; white-space:normal; word-break:break-all; color:#000000;' colspan='7'>{{amountInWords}}</td></tr><tr style='height:28px;'><td style='border:1px solid #000; background:#F5F5F5; text-align:center; font-weight:bold; color:#000000;'>金额(小写)</td><td style='border:1px solid #000; padding:0 4px; font-weight:normal; white-space:normal; word-break:break-all; color:#000000;' colspan='7'>{{balanceAmount}}</td></tr></table>",
"fixed": true
},
"printElementType": {
"title": "HTML表格",
"type": "text"
}
},
{
"options": {
"left": 25.0,
"top": 300.0,
"height": 55.0,
"width": 55.0,
"field": "receiptNo",
"hideTitle": true,
"fixed": true
},
"printElementType": {
"type": "qrcode"
}
},
{
"options": {
"left": 15.0,
"top": 359.0,
"height": 11.34,
"width": 80.0,
"title": "扫码查验电子票据",
"textAlign": "center",
"fontSize": 7,
"color": "#000000",
"fixed": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 113.39,
"top": 300.0,
"height": 65.0,
"width": 467.7,
"title": "说明/备注:\n1. 本收据为预收款凭证,非最终医疗自费/统筹消费发票。\n2. 患者出院结算时,须凭此收据联原件退回换取正式的住院发票。\n3. 请妥善保管此收据。如若遗失,请及时前往收费处办理挂失及证明审核。",
"fontSize": 8,
"lineHeight": 14,
"color": "#000000",
"fixed": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 14.17,
"top": 376.0,
"height": 14.17,
"width": 566.92,
"title": "根据《中华人民共和国电子签名法》规定,本电子票据由医院开具并经国家电子认证中心认证,具有法律效力。请妥善保管。",
"textAlign": "center",
"fontSize": 7,
"color": "#000000",
"fixed": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 14.17,
"top": 396.0,
"height": 17.01,
"width": 320.0,
"title": "收款单位:{{hospitalName}}财务结算专用章(电子印章)",
"fontSize": 9,
"color": "#000000",
"fixed": true
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 330.0,
"top": 396.0,
"height": 17.01,
"width": 251.1,
"title": "收款员:{{cashier}}",
"textAlign": "right",
"fontSize": 9,
"color": "#000000",
"fixed": true
}, },
"printElementType": { "printElementType": {
"title": "文本", "title": "文本",
@@ -335,4 +261,4 @@
] ]
} }
] ]
} }

View File

@@ -301,9 +301,19 @@ export function executePrint(data, template, printerName, options = {}, business
let processedTemplate; let processedTemplate;
try { try {
processedTemplate = JSON.parse( let templateStr = JSON.stringify(template);
JSON.stringify(template).replace(/{{HOSPITAL_NAME}}/g, userStore.hospitalName) // 统一处理医院名称占位符(支持大小写)
); const hospitalName = userStore.hospitalName || data.hospitalName || "中联医院";
templateStr = templateStr.replace(/\{\{HOSPITAL_NAME\}\}/gi, hospitalName);
if (data && typeof data === 'object') {
Object.keys(data).forEach(key => {
// 使用更安全的替换方式
const val = data[key] ?? '';
templateStr = templateStr.split(`{{${key}}}`).join(val);
});
}
processedTemplate = JSON.parse(templateStr);
console.log('[4] 模板处理成功'); console.log('[4] 模板处理成功');
} catch (parseError) { } catch (parseError) {
console.error('[4] 模板处理失败:', parseError); console.error('[4] 模板处理失败:', parseError);
@@ -332,8 +342,8 @@ export function executePrint(data, template, printerName, options = {}, business
const printOptions = { const printOptions = {
title: '打印标题', title: '打印标题',
height: 210, width: 210,
width: 148, height: 297,
...options, ...options,
}; };
console.log('[7] 打印选项:', printOptions); console.log('[7] 打印选项:', printOptions);
@@ -385,7 +395,13 @@ export function executePrint(data, template, printerName, options = {}, business
hiprintTemplate.print(data, printOptions, { hiprintTemplate.print(data, printOptions, {
styleHandler: () => { styleHandler: () => {
console.log('[10] styleHandler被调用'); console.log('[10] styleHandler被调用');
return '<style>@media print { @page { margin: 0; } }</style>'; // 从 printOptions 获取纸张尺寸mm用于 @page size
const pageWidth = printOptions.width || 210;
const pageHeight = printOptions.height || 297;
const pageStyle = `<style>@media print { @page { size: ${pageWidth}mm ${pageHeight}mm; margin: 0; } }</style>`;
// 合并外部传入的 styleHandler包含元素定位样式与内部 @page 样式
const externalStyle = (options && typeof options.styleHandler === 'function') ? options.styleHandler() : '';
return pageStyle + externalStyle;
}, },
callback: (e) => { callback: (e) => {
console.log('[10] 打印回调被调用:', e); console.log('[10] 打印回调被调用:', e);

View File

@@ -1,4 +1,4 @@
<template> <template>
<div class="container"> <div class="container">
<!-- 顶部操作区域 --> <!-- 顶部操作区域 -->
<el-card <el-card
@@ -252,6 +252,7 @@
import {nextTick, ref} from 'vue'; import {nextTick, ref} from 'vue';
import {simplePrint, PRINT_TEMPLATE} from '@/utils/printUtils'; import {simplePrint, PRINT_TEMPLATE} from '@/utils/printUtils';
import {getDepositInfo, getDepositInfoPage} from './components/api'; import {getDepositInfo, getDepositInfoPage} from './components/api';
import useUserStore from '@/store/modules/user';
import PatientList from './components/patientList.vue'; import PatientList from './components/patientList.vue';
import ChargeDialog from './components/chargeDialog.vue'; import ChargeDialog from './components/chargeDialog.vue';
import RefundDialog from './components/refundDialog.vue'; import RefundDialog from './components/refundDialog.vue';
@@ -343,18 +344,44 @@ async function handlePrint(row) {
return; return;
} }
try { try {
const userStore = useUserStore();
const amountValue = row.tenderedAmount || 0;
const printData = { const printData = {
patientName: patientInfo.value.patientName || "", hospitalName: userStore.hospitalName || "中联医院",
encounterNosd: patientInfo.value.busNo || "", receiptNo: row.paymentNo || "",
inHospitalOrgName: patientInfo.value.inHospitalOrgName || "",
patientId: patientInfo.value.patientId || "",
contractName: patientInfo.value.contractName || "",
currentTime: row.operateTime || new Date().toLocaleString(), currentTime: row.operateTime || new Date().toLocaleString(),
balanceAmount: row.tenderedAmount ? row.tenderedAmount.toFixed(2) : "0.00", // 补打标记
amountInWords: "", reprintTag: row.printCount && row.printCount > 0 ? `[ 补打第 ${row.printCount} 次 ]` : `[ 补打第 1 次 ]`,
paymentDetails: "收据号: " + (row.paymentNo || ""), // 患者信息
encounterNosd: patientInfo.value.busNo || "",
patientName: patientInfo.value.patientName || "",
gender: patientInfo.value.genderEnum_enumText || "",
age: patientInfo.value.age ? patientInfo.value.age + "岁" : "",
// 科室信息
inHospitalOrgName: patientInfo.value.inHospitalOrgName || "",
bedName: patientInfo.value.bedName || "",
contractName: patientInfo.value.contractName || "自费",
// 费用信息
chargeItem: "住院预缴款",
paymentMethod: row.paymentEnum_enumText || "现金",
amountInWords: "人民币:" + convertToChineseNumber(amountValue),
balanceAmount: "¥ " + amountValue.toFixed(2) + " 元",
cashier: userStore.nickName || "",
}; };
await simplePrint(PRINT_TEMPLATE.ADVANCE_PAYMENT, printData); // 切换为 A5 横向尺寸 (210mm x 148mm)
await simplePrint(PRINT_TEMPLATE.ADVANCE_PAYMENT, printData, undefined, {
width: 210,
height: 148,
styleHandler: () => {
return `
<style>
.hiprint-printElement { position: absolute !important; }
.hiprint-printElement * { color: #000000 !important; }
.hiprint-printElement[style*="color"] * { color: inherit !important; }
</style>
`;
}
});
proxy.$modal.msgSuccess("打印成功"); proxy.$modal.msgSuccess("打印成功");
} catch (error) { } catch (error) {
console.error("预交金打印失败:", error); console.error("预交金打印失败:", error);
@@ -362,6 +389,60 @@ async function handlePrint(row) {
} }
} }
/**
* 将数字金额转换为人民币大写
*/
function convertToChineseNumber(amount) {
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
const units = ['', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿'];
const decimalUnits = ['角', '分'];
const absAmount = Math.abs(amount);
let [integer, decimal] = absAmount.toFixed(2).split('.');
let result = amount < 0 ? '负' : '';
// 处理整数部分
if (parseInt(integer) === 0) {
result += '零元';
} else {
for (let i = 0; i < integer.length; i++) {
const digit = parseInt(integer[i]);
const position = integer.length - i - 1;
if (digit !== 0) {
result += digits[digit] + units[position];
} else {
if (i > 0 && parseInt(integer[i - 1]) !== 0) {
result += digits[digit];
}
if (position % 4 === 0 && position > 0) {
result += units[position];
}
}
}
result += '元';
}
// 处理小数部分
if (parseInt(decimal) === 0) {
result += '整';
} else {
if (parseInt(decimal[0]) > 0) {
result += digits[parseInt(decimal[0])] + decimalUnits[0];
} else if (parseInt(decimal[1]) > 0) {
result += digits[0];
}
if (parseInt(decimal[1]) > 0) {
result += digits[parseInt(decimal[1])] + decimalUnits[1];
} else if (parseInt(decimal[0]) > 0) {
result += '整';
}
}
return result;
}
/** 选择病人 */ /** 选择病人 */
function handlePatientSelected(row) { function handlePatientSelected(row) {
// console.log(row, 'rowwwwwwwwhandlePatientSelected'); // console.log(row, 'rowwwwwwwwhandlePatientSelected');

View File

@@ -569,17 +569,21 @@ const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsurance
patientName: patientInfo.patientName || '', // 姓名 patientName: patientInfo.patientName || '', // 姓名
patientId: patientInfo.idCard || patientInfo.patientCode || '', // ID号 patientId: patientInfo.idCard || patientInfo.patientCode || '', // ID号
contractName: patientInfo.contractName || '自费', // 医保类别 contractName: patientInfo.contractName || '自费', // 医保类别
gender: patientInfo.genderEnum_enumText || '', // 性别
age: patientInfo.age ? patientInfo.age + '岁' : '', // 年龄
// 住院信息 // 住院信息
encounterNo: inHospitalInfo.encounterNo || '', // 住院号 encounterNosd: inHospitalInfo.encounterNo || '', // 住院号
inHospitalOrgName: inHospitalInfo.inHospitalOrgName || '', // 机构名称 inHospitalOrgName: inHospitalInfo.inHospitalOrgName || '', // 机构名称
bedName: inHospitalInfo.bedName || '', // 床号
// 费用信息 // 费用信息
balanceAmount: advance.value || '0.00', // 金额 balanceAmount: '¥ ' + parseFloat(advance.value || 0).toFixed(2) + ' 元', // 金额
amountInWords: convertToChineseNumber(advance.value || '0.00'), // 人民币大写 amountInWords: '人民币:' + convertToChineseNumber(advance.value || '0.00'), // 人民币大写
// 支付方式详情 // 支付方式详情
paymentDetails: paymentDetails, paymentDetails: paymentDetails,
paymentMethod: paymentDetails, // 支付方式绑定
// 时间信息 // 时间信息
currentTime: new Date().toLocaleString('zh-CN', { currentTime: new Date().toLocaleString('zh-CN', {
@@ -593,17 +597,27 @@ const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsurance
// 其他信息 // 其他信息
cashier: userStore?.nickName || '', // 收款人(收费员) cashier: userStore?.nickName || '', // 收款人(收费员)
medicalInsuranceTitle: medicalInsuranceTitle || '', // 医保标题信息 hospitalName: userStore?.hospitalName || '', // 医院名称
receiptNo: '', // 挂号处打印可能还没有收据号
reprintTag: '', // 首次打印为空
}; };
console.log(printData, 'dayin 预交金printData'); console.log(printData, 'dayin 预交金printData');
// 直接导入并使用指定的预交金打印模板 // 使用 simplePrint 执行打印,并指定 A5 横向尺寸
const templateModule = await import('@/components/Print/AdvancePayment.json'); await printUtils.simplePrint(printUtils.TEMPLATE.ADVANCE_PAYMENT, printData, undefined, {
let template = templateModule.default || templateModule; width: 210,
height: 148,
// 使用printUtils执行打印 styleHandler: () => {
await printUtils.executePrint(printData, template); return `
<style>
.hiprint-printElement { position: absolute !important; }
.hiprint-printElement * { color: #000000 !important; }
.hiprint-printElement[style*="color"] * { color: inherit !important; }
</style>
`;
}
});
console.log('预交金收据打印成功'); console.log('预交金收据打印成功');
} catch (error) { } catch (error) {
console.error('打印失败:', error); console.error('打印失败:', error);

View File

@@ -184,7 +184,9 @@ handleGetPrescription();
function handleGetPrescription() { function handleGetPrescription() {
loading.value = true; loading.value = true;
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(','); let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
const params = {}; const params = {
encounterIds: encounterIds || undefined
};
if (props.therapyEnum !== undefined) { if (props.therapyEnum !== undefined) {
params.therapyEnum = props.therapyEnum; params.therapyEnum = props.therapyEnum;
} }