前端最新版本同步

This commit is contained in:
Zhang.WH
2025-09-25 10:36:07 +08:00
parent a3a06d6f3c
commit 1276dc4adb
117 changed files with 11964 additions and 2466 deletions

View File

@@ -92,7 +92,7 @@ export function unprecharge(data) {
*/
export function dispenseMedicalConsumables(data) {
return request({
url: '/pharmacy-manage/medical-consumables-dispense/consumables-dispense',
url: '/pharmacy-manage/device-dispense/consumables-dispense',
method: 'put',
data: data
})

View File

@@ -108,6 +108,7 @@
<el-button type="primary" @click="throttledGetList" :disabled="dialogLoading"
> </el-button
>
<el-button type="primary" @click="print()" :disabled="dialogLoading"> </el-button>
<el-button @click="close" :disabled="dialogLoading"> </el-button>
</div>
</template>
@@ -120,6 +121,8 @@ import { computed, watch, reactive, ref, getCurrentInstance, nextTick } from 'vu
import { Delete } from '@element-plus/icons-vue';
import { debounce } from 'lodash-es';
import useUserStore from '@/store/modules/user';
import { hiprint } from 'vue-plugin-hiprint';
import templateJson from './template.json';
const props = defineProps({
open: {
@@ -159,6 +162,10 @@ const props = defineProps({
type: Object,
default: undefined,
},
chargedItems: {
type: [],
default: [],
},
});
const { proxy } = getCurrentInstance();
@@ -269,29 +276,50 @@ async function printReceipt(param) {
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, // 病例号
currentDate: currentDate.value, // 收费日期
chargedItems: props.chargedItems, // 收费项目
totalAmount: props.totalAmount.toFixed(2) + ' 元', // 应收金额
displayAmount: displayAmount.value + ' 元', // 实收金额
returnedAmount: returnedAmount.value + ' 元', // 应找零
},
],
// feeDetial: param.detail, //收费项目,后端还未返回
};
// 将对象转换为 JSON 字符串
let jsonString = JSON.stringify(result, null, 2);
console.log(jsonString, 'jsonString');
await CefSharp.BindObjectAsync('boundAsync');
await boundAsync.printReport(
'门诊收费明细单.grf',
jsonString
)
.then((response) => {
//返回结果是jsonString可判断其调用是否成功
console.log(response, 'response');
var res = JSON.parse(response);
if (!res.IsSuccess) {
proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
}
})
.catch((error) => {
proxy.$modal.msgError('调用打印插件失败:' + error);
});
console.log(result, '==result.data==');
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
const printerList = hiprintTemplate.getPrinterList();
console.log(hiprintTemplate, '打印机列表');
hiprintTemplate.print2(result.data[0], {
printer: 'xp',
title: '门诊收费结算单',
});
// // 将对象转换为 JSON 字符串
// let jsonString = JSON.stringify(result, null, 2);
// console.log(jsonString, 'jsonString');
// await CefSharp.BindObjectAsync('boundAsync');
// await boundAsync.printReport(
// '门诊收费明细单.grf',
// jsonString
// )
// .then((response) => {
// //返回结果是jsonString可判断其调用是否成功
// console.log(response, 'response');
// var res = JSON.parse(response);
// if (!res.IsSuccess) {
// proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
// }
// })
// .catch((error) => {
// proxy.$modal.msgError('调用打印插件失败:' + error);
// });
}
const throttledGetList = debounce(submit, 300);
@@ -333,13 +361,22 @@ async function submit() {
})
.then((res) => {
if (res.code == 200) {
printReceipt(res.data);
(formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]),
emit('close', 'success', res.msg);
// 长春大学自动发耗材
if (userStore.fixmedinsCode == 'H22010200672' && props.consumablesIdList.length > 0) {
dispenseMedicalConsumables(props.consumablesIdList);
}
// // 添加确认窗口
// proxy.$modal
// .confirm('是否打印收费结算单?')
// .then(() => {
// printReceipt(res.data);
// })
// .catch(() => {
// // 用户取消打印
// console.log('用户取消打印');
// });
}
})
.finally(() => {
@@ -347,6 +384,43 @@ async function submit() {
});
}
/** 打印收费结算单 */
async function print() {
console.log('patientInfo', props.patientInfo);
console.log('category', props.category);
console.log('totalAmount', props.totalAmount);
console.log('chargeItemIds', props.chargeItemIds);
console.log('consumablesIdList', props.consumablesIdList);
console.log('userCardInfo', props.userCardInfo);
console.log('paymentId', props.paymentId);
console.log('details', props.details);
console.log('chargedItems', props.chargedItems);
const result = {
data: [
{
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) + ' 元', // 应收金额
displayAmount: displayAmount.value + ' 元', // 实收金额
returnedAmount: returnedAmount.value + ' 元', // 应找零
},
],
};
console.log(result, '==result.data==');
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
const printerList = hiprintTemplate.getPrinterList();
console.log(hiprintTemplate, '打印机列表');
hiprintTemplate.print2(result.data[0], {
title: '门诊收费结算单',
});
}
const currentDate = ref(new Date().toLocaleString());
const selfPayMethods = [

View File

@@ -0,0 +1,451 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 200,
"width": 80,
"paperNumberContinue": true,
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "36px",
"rotate": 25,
"width": 413,
"height": 310,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {
"layoutType": "column",
"layoutRowGap": 0,
"layoutColumnGap": 0
},
"paperHeader": 0,
"paperFooter": 841.8897637795277,
"printElements": [
{
"options": {
"left": 55.5,
"top": 24,
"height": 16.5,
"width": 120,
"title": "长大医院门诊收费结算单",
"coordinateSync": false,
"widthHeightSync": false,
"fontWeight": "bold",
"letterSpacing": 0.75,
"textAlign": "center",
"qrCodeLevel": 0,
"fontSize": 10
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 142.5,
"top": 45,
"height": 80,
"width": 70,
"textAlign": "center",
"title": "院内门诊号",
"qrCodeLevel": 0,
"coordinateSync": false,
"widthHeightSync": false,
"field": "encounterBusNo"
},
"printElementType": {
"title": "二维码",
"type": "qrcode"
}
},
{
"options": {
"left": 15,
"top": 55.5,
"height": 14,
"width": 80,
"title": "姓名",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "name"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 78,
"height": 14,
"width": 60,
"title": "性别",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "gender"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 75,
"top": 78,
"height": 14,
"width": 60,
"title": "年龄",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "age"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 105,
"height": 14,
"width": 120,
"title": "病人类型",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "medType"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 127.5,
"height": 14,
"width": 120,
"title": "病历号",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "encounterBusNo"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 157,
"height": 37.5,
"width": 200,
"title": "undefined+beforeDragIn",
"field": "chargedItems",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"tableBodyRowBorder": "border",
"tableBodyCellBorder": "border",
"columns": [
[
{
"title": "收费名称",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 70.07165247626199,
"field": "itemName",
"checked": true,
"columnId": "itemName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "数量",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 38.66458945433993,
"field": "quantityValue",
"checked": true,
"columnId": "quantityValue",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "金额",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 50.90935931687881,
"field": "totalPrice",
"checked": true,
"columnId": "totalPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "费用性质",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 40.354398752519245,
"field": "contractName",
"checked": true,
"columnId": "contractName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "收费名称",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 56.86712269302148,
"field": "chargeItem",
"checked": false,
"columnId": "chargeItem",
"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": 15,
"top": 225,
"height": 14,
"width": 180,
"title": "个人现金支付金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_CASH_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 250,
"height": 14,
"width": 180,
"title": "个人负担总金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 275,
"height": 14,
"width": 180,
"title": "基金支付总额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_FUND_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 13.5,
"top": 300,
"height": 14,
"width": 180,
"title": "基本医保统筹基金支出",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_TC_FUND_AMOUNT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 325,
"height": 14,
"width": 180,
"title": "个人医保账户支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_YB_ZH_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 349.5,
"height": 14,
"width": 180,
"title": "全自费金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "FULAMT_OWNPAY_AMT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 375,
"height": 14,
"width": 180,
"title": "应收金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "totalAmount"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 400,
"height": 14,
"width": 180,
"title": "实收金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "displayAmount"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 425,
"height": 14,
"width": 180,
"title": "应找零",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "returnedAmount"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 450,
"height": 14,
"width": 100,
"title": "收费员",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 475,
"height": 14,
"width": 170,
"title": "收费时间",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "currentDate"
},
"printElementType": {
"title": "文本",
"type": "text"
}
}
]
}
]
}