前端最新版本同步
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user