700 710 711 713 bug 修复
This commit is contained in:
@@ -150,10 +150,21 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
|
||||
@Override
|
||||
public R<?> getMedicineSummaryFormPage(DispenseFormSearchParam dispenseFormSearchParam, Integer pageNo,
|
||||
Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
// 就诊ID集合
|
||||
String encounterIds = dispenseFormSearchParam.getEncounterIds();
|
||||
dispenseFormSearchParam.setEncounterIds(null);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DispenseFormSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(dispenseFormSearchParam,
|
||||
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(
|
||||
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(),
|
||||
|
||||
@@ -3,33 +3,32 @@
|
||||
{
|
||||
"index": 0,
|
||||
"name": 1,
|
||||
"paperType": "自定义",
|
||||
"height": 80,
|
||||
"width": 279,
|
||||
"paperType": "A5",
|
||||
"height": 148,
|
||||
"width": 210,
|
||||
"paperList": {
|
||||
"type": "自定义",
|
||||
"width": 279,
|
||||
"height": 80
|
||||
"type": "A5",
|
||||
"width": 210,
|
||||
"height": 148
|
||||
},
|
||||
"panelPageRule": "none",
|
||||
"paperHeader": 0,
|
||||
"paperFooter": 422.3622047244095,
|
||||
"paperFooter": 419.53,
|
||||
"paperNumberDisabled": true,
|
||||
"paperNumberContinue": true,
|
||||
"panelAngle": 0,
|
||||
"overPrintOptions": {
|
||||
"content": "",
|
||||
"opacity": 0.7,
|
||||
"opacity": 0.01,
|
||||
"type": 1
|
||||
},
|
||||
"watermarkOptions": {
|
||||
"content": "",
|
||||
"fillStyle": "rgba(87, 13, 248, 0.5)",
|
||||
"fontSize": "36px",
|
||||
"rotate": 25,
|
||||
"width": 413,
|
||||
"height": 310,
|
||||
"timestamp": true,
|
||||
"fontSize": "10px",
|
||||
"rotate": 0,
|
||||
"width": 100,
|
||||
"height": 100,
|
||||
"timestamp": false,
|
||||
"format": "YYYY-MM-DD HH:mm"
|
||||
},
|
||||
"panelLayoutOptions": {
|
||||
@@ -40,238 +39,30 @@
|
||||
"printElements": [
|
||||
{
|
||||
"options": {
|
||||
"left": 0,
|
||||
"top": 15,
|
||||
"height": 16.5,
|
||||
"width": 792,
|
||||
"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,
|
||||
"left": 505.5,
|
||||
"top": 20,
|
||||
"height": 20,
|
||||
"width": 60,
|
||||
"title": " ",
|
||||
"field": "reprintTag",
|
||||
"hideTitle": true,
|
||||
"customClass": "reprint-tag",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"textAlign": "center",
|
||||
"textContentVerticalAlign": "middle",
|
||||
"fontSize": 9,
|
||||
"color": "#ff0000",
|
||||
"fontWeight": "bold",
|
||||
"borderLeft": "solid",
|
||||
"borderRight": "solid",
|
||||
"borderTop": "solid",
|
||||
"borderBottom": "solid",
|
||||
"borderColor": "#ff0000",
|
||||
"borderWidth": 1.5,
|
||||
"qrCodeLevel": 0,
|
||||
"field": "paymentDetails",
|
||||
"hideTitle": true
|
||||
"fixed": true,
|
||||
"styler": "function(value, options, target, templateData, paperNo) { if (!value || value.trim() === '') { return { display: 'none' }; } return {}; }"
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
@@ -280,16 +71,20 @@
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 111,
|
||||
"top": 198,
|
||||
"height": 14,
|
||||
"width": 120,
|
||||
"title": "签章",
|
||||
"left": 30,
|
||||
"top": 20,
|
||||
"height": 30,
|
||||
"width": 535.5,
|
||||
"title": "{{hospitalName}}",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0,
|
||||
"field": "patientNamesfs",
|
||||
"fontFamily": "Microsoft YaHei"
|
||||
"textAlign": "center",
|
||||
"fontWeight": "bold",
|
||||
"fontSize": 19.5,
|
||||
"fontFamily": "SimSun",
|
||||
"letterSpacing": 5,
|
||||
"color": "#000000",
|
||||
"fixed": true
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
@@ -298,16 +93,20 @@
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 297,
|
||||
"top": 198,
|
||||
"height": 14,
|
||||
"width": 132,
|
||||
"title": "交款人",
|
||||
"left": 30,
|
||||
"top": 52,
|
||||
"height": 20,
|
||||
"width": 535.5,
|
||||
"title": "住院预缴金收据(收执联)",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0,
|
||||
"field": "patientNameada",
|
||||
"fontFamily": "Microsoft YaHei"
|
||||
"textAlign": "center",
|
||||
"fontSize": 12,
|
||||
"fontFamily": "SimSun",
|
||||
"fontWeight": "normal",
|
||||
"letterSpacing": 2,
|
||||
"color": "#000000",
|
||||
"fixed": true
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
@@ -316,16 +115,143 @@
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 481.5,
|
||||
"top": 198,
|
||||
"height": 14,
|
||||
"width": 124.5,
|
||||
"title": "收款人",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0,
|
||||
"field": "cashier",
|
||||
"fontFamily": "Microsoft YaHei"
|
||||
"left": 30,
|
||||
"top": 78,
|
||||
"height": 15,
|
||||
"width": 250,
|
||||
"title": "收据号:{{receiptNo}}",
|
||||
"fontSize": 9,
|
||||
"color": "#000000",
|
||||
"fixed": true
|
||||
},
|
||||
"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": {
|
||||
"title": "文本",
|
||||
@@ -335,4 +261,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -301,9 +301,19 @@ export function executePrint(data, template, printerName, options = {}, business
|
||||
|
||||
let processedTemplate;
|
||||
try {
|
||||
processedTemplate = JSON.parse(
|
||||
JSON.stringify(template).replace(/{{HOSPITAL_NAME}}/g, userStore.hospitalName)
|
||||
);
|
||||
let templateStr = JSON.stringify(template);
|
||||
// 统一处理医院名称占位符(支持大小写)
|
||||
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] 模板处理成功');
|
||||
} catch (parseError) {
|
||||
console.error('[4] 模板处理失败:', parseError);
|
||||
@@ -332,8 +342,8 @@ export function executePrint(data, template, printerName, options = {}, business
|
||||
|
||||
const printOptions = {
|
||||
title: '打印标题',
|
||||
height: 210,
|
||||
width: 148,
|
||||
width: 210,
|
||||
height: 297,
|
||||
...options,
|
||||
};
|
||||
console.log('[7] 打印选项:', printOptions);
|
||||
@@ -385,7 +395,13 @@ export function executePrint(data, template, printerName, options = {}, business
|
||||
hiprintTemplate.print(data, printOptions, {
|
||||
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) => {
|
||||
console.log('[10] 打印回调被调用:', e);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<div class="container">
|
||||
<!-- 顶部操作区域 -->
|
||||
<el-card
|
||||
@@ -252,6 +252,7 @@
|
||||
import {nextTick, ref} from 'vue';
|
||||
import {simplePrint, PRINT_TEMPLATE} from '@/utils/printUtils';
|
||||
import {getDepositInfo, getDepositInfoPage} from './components/api';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import PatientList from './components/patientList.vue';
|
||||
import ChargeDialog from './components/chargeDialog.vue';
|
||||
import RefundDialog from './components/refundDialog.vue';
|
||||
@@ -343,18 +344,44 @@ async function handlePrint(row) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const userStore = useUserStore();
|
||||
const amountValue = row.tenderedAmount || 0;
|
||||
const printData = {
|
||||
patientName: patientInfo.value.patientName || "",
|
||||
encounterNosd: patientInfo.value.busNo || "",
|
||||
inHospitalOrgName: patientInfo.value.inHospitalOrgName || "",
|
||||
patientId: patientInfo.value.patientId || "",
|
||||
contractName: patientInfo.value.contractName || "",
|
||||
hospitalName: userStore.hospitalName || "中联医院",
|
||||
receiptNo: row.paymentNo || "",
|
||||
currentTime: row.operateTime || new Date().toLocaleString(),
|
||||
balanceAmount: row.tenderedAmount ? row.tenderedAmount.toFixed(2) : "0.00",
|
||||
amountInWords: "",
|
||||
paymentDetails: "收据号: " + (row.paymentNo || ""),
|
||||
// 补打标记
|
||||
reprintTag: row.printCount && row.printCount > 0 ? `[ 补打第 ${row.printCount} 次 ]` : `[ 补打第 1 次 ]`,
|
||||
// 患者信息
|
||||
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("打印成功");
|
||||
} catch (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) {
|
||||
// console.log(row, 'rowwwwwwwwhandlePatientSelected');
|
||||
|
||||
@@ -569,17 +569,21 @@ const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsurance
|
||||
patientName: patientInfo.patientName || '', // 姓名
|
||||
patientId: patientInfo.idCard || patientInfo.patientCode || '', // ID号
|
||||
contractName: patientInfo.contractName || '自费', // 医保类别
|
||||
gender: patientInfo.genderEnum_enumText || '', // 性别
|
||||
age: patientInfo.age ? patientInfo.age + '岁' : '', // 年龄
|
||||
|
||||
// 住院信息
|
||||
encounterNo: inHospitalInfo.encounterNo || '', // 住院号
|
||||
encounterNosd: inHospitalInfo.encounterNo || '', // 住院号
|
||||
inHospitalOrgName: inHospitalInfo.inHospitalOrgName || '', // 机构名称
|
||||
bedName: inHospitalInfo.bedName || '', // 床号
|
||||
|
||||
// 费用信息
|
||||
balanceAmount: advance.value || '0.00', // 金额
|
||||
amountInWords: convertToChineseNumber(advance.value || '0.00'), // 人民币大写
|
||||
balanceAmount: '¥ ' + parseFloat(advance.value || 0).toFixed(2) + ' 元', // 金额
|
||||
amountInWords: '人民币:' + convertToChineseNumber(advance.value || '0.00'), // 人民币大写
|
||||
|
||||
// 支付方式详情
|
||||
paymentDetails: paymentDetails,
|
||||
paymentMethod: paymentDetails, // 支付方式绑定
|
||||
|
||||
// 时间信息
|
||||
currentTime: new Date().toLocaleString('zh-CN', {
|
||||
@@ -593,17 +597,27 @@ const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsurance
|
||||
|
||||
// 其他信息
|
||||
cashier: userStore?.nickName || '', // 收款人(收费员)
|
||||
medicalInsuranceTitle: medicalInsuranceTitle || '', // 医保标题信息
|
||||
hospitalName: userStore?.hospitalName || '', // 医院名称
|
||||
receiptNo: '', // 挂号处打印可能还没有收据号
|
||||
reprintTag: '', // 首次打印为空
|
||||
};
|
||||
|
||||
console.log(printData, 'dayin 预交金printData');
|
||||
|
||||
// 直接导入并使用指定的预交金打印模板
|
||||
const templateModule = await import('@/components/Print/AdvancePayment.json');
|
||||
let template = templateModule.default || templateModule;
|
||||
|
||||
// 使用printUtils执行打印
|
||||
await printUtils.executePrint(printData, template);
|
||||
// 使用 simplePrint 执行打印,并指定 A5 横向尺寸
|
||||
await printUtils.simplePrint(printUtils.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>
|
||||
`;
|
||||
}
|
||||
});
|
||||
console.log('预交金收据打印成功');
|
||||
} catch (error) {
|
||||
console.error('打印失败:', error);
|
||||
|
||||
@@ -184,7 +184,9 @@ handleGetPrescription();
|
||||
function handleGetPrescription() {
|
||||
loading.value = true;
|
||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||
const params = {};
|
||||
const params = {
|
||||
encounterIds: encounterIds || undefined
|
||||
};
|
||||
if (props.therapyEnum !== undefined) {
|
||||
params.therapyEnum = props.therapyEnum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user