diff --git a/healthlink-his-ui/src/utils/printUtils.js b/healthlink-his-ui/src/utils/printUtils.js
index d7b6d81cd..af70501d1 100755
--- a/healthlink-his-ui/src/utils/printUtils.js
+++ b/healthlink-his-ui/src/utils/printUtils.js
@@ -689,6 +689,164 @@ function maskIdCard(idCard) {
return idCard;
}
+/**
+ * 打印入院证
+ * @param {Object} data 入院证数据
+ * @returns {Promise}
+ */
+export function printAdmissionCertificate(data) {
+ return new Promise((resolve, reject) => {
+ try {
+ const printContent = `
+
+
${data.hospitalName || '医院'}
+
入 院 证
+
+
+
+
+
姓名:${data.patientName || '—'}
+
性别:${data.gender || '—'}
+
年龄:${data.age || '—'}
+
费用类型:${data.feeType || '—'}
+
+
+
+
身份证号:${data.idCard || '—'}
+
电话:${data.phone || '—'}
+
+
+
+
住址:${data.address || '—'}
+
+
+
+
联系人:${data.contactPerson || '—'}${data.contactRelation ? '(' + data.contactRelation + ')' : ''} ${data.contactPhone || ''}
+
+
+
+
+
+
入院科室:${data.department || '—'}
+
入院类型:${data.admissionType || '—'}
+
入院病区:${data.ward || '—'}
+
+
+
+
入院方式:${data.admissionMethod || '—'}
+
患者病情:${data.patientCondition || '—'}
+
+
+
+
+
+
入院诊断:
+
1. ${data.westernDiagnosis || '—'}(西医)
+
2. ${data.tcmDiagnosis || '—'}(中医)
+
+
+
+
+
+
开单医生:${data.doctor || '—'}(签名)
+
交款金额:¥${data.paymentAmount || '0.00'} 元(盖章有效)
+
+
+
+
申请日期:${data.applicationDate || '—'}
+
登记人员:${data.registrar || '—'}(签章)
+
+
+
+
+
+
【温馨提示】
+
1. 医保患者请于24小时内持医保卡至住院窗口办理联网,逾期无法报销。
+
2. 住院期间请勿随身携带贵重物品,请携带必要洗漱用具。
+
3. 本证3日内有效。
+
+
+ `;
+
+ const printWindow = window.open('', '_blank');
+ if (!printWindow) {
+ reject(new Error('无法打开打印窗口,请检查浏览器弹窗设置'));
+ return;
+ }
+
+ printWindow.document.write(`
+
+
+
+
+ 入院证
+
+
+
+ ${printContent}
+
+
+ `);
+
+ printWindow.document.close();
+ printWindow.onload = function () {
+ setTimeout(() => {
+ printWindow.print();
+ resolve({ success: true, message: '打印窗口已打开' });
+ }, 300);
+ };
+ } catch (error) {
+ console.error('打印入院证失败:', error);
+ reject(error);
+ }
+ });
+}
+
+/**
+ * 格式化日期
+ * @param {string|Date} date 日期
+ * @returns {string} 格式化后的日期字符串
+ */
+export function formatDate(date) {
+ if (!date) return '';
+ const d = new Date(date);
+ if (isNaN(d.getTime())) return '';
+ const year = d.getFullYear();
+ const month = String(d.getMonth() + 1).padStart(2, '0');
+ const day = String(d.getDate()).padStart(2, '0');
+ const hours = String(d.getHours()).padStart(2, '0');
+ const minutes = String(d.getMinutes()).padStart(2, '0');
+ const seconds = String(d.getSeconds()).padStart(2, '0');
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+}
+
// 默认导出简化的打印方法
export default {
print: simplePrint,
@@ -699,4 +857,6 @@ export default {
getPrinterList,
getCachedPrinter,
savePrinterToCache,
+ printAdmissionCertificate,
+ formatDate,
};
diff --git a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue
index 8cf5e8c94..2e8842416 100755
--- a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue
+++ b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue
@@ -17,15 +17,19 @@
>
查询
+ 打印住院证
+
+
+
+ 已作废
+ 已入科
+ 已登记
+
+
-
-
-
- {{ scope.row.statusEnum == 8 ? '已作废' : '已登记' }}
-
-
-
{
})
.catch(() => {});
};
+
+const handleRadioChange = ({ newValue }) => {
+ selectedRow.value = newValue;
+};
+
+const handlePrintCertificate = async () => {
+ if (!selectedRow.value) {
+ ElMessage.warning('请先从列表中选中一位患者');
+ return;
+ }
+
+ const row = selectedRow.value;
+
+ if (row.statusEnum == 8) {
+ ElMessage.warning('该记录已作废,无法打印入院证');
+ return;
+ }
+
+ try {
+ // 获取患者基本信息和住院信息
+ const [patientRes, hospitalRes] = await Promise.all([
+ getPatientBasicInfo(row.patientId),
+ getInHospitalInfo(row.encounterId),
+ ]);
+
+ const patient = patientRes.data || {};
+ const hospital = hospitalRes.data || {};
+
+ const printData = {
+ hospitalName: userStore.hospitalName || userStore.tenantName || '',
+ outpatientNo: patient.busNo || '',
+ inpatientNo: row.busNo || '',
+ patientName: row.patientName || '',
+ gender: row.genderEnum_enumText || '',
+ age: row.age || '',
+ feeType: row.contractNo || '',
+ idCard: patient.idCard || '',
+ phone: patient.phone || '',
+ address: patient.address || '',
+ contactPerson: patient.linkName || '',
+ contactRelation: patient.linkRelationCode_enumText || '',
+ contactPhone: patient.linkTelcom || '',
+ department: row.sourceName || hospital.inHospitalOrgName || '',
+ admissionType: row.admitSourceCode || '',
+ ward: row.wardName || hospital.wardName || '',
+ admissionMethod: hospital.inWayCode_dictText || '',
+ patientCondition: hospital.priorityEnum_enumText || '',
+ westernDiagnosis: hospital.ambDiagnosisName || '',
+ tcmDiagnosis: '',
+ doctor: hospital.ambDoctorPractitionerName || '',
+ paymentAmount: hospital.balanceAmount ? Number(hospital.balanceAmount).toFixed(2) : '0.00',
+ applicationDate: formatDate(hospital.startTime || row.requestTime),
+ registrar: row.registrar || '',
+ };
+
+ await printAdmissionCertificate(printData);
+ } catch (error) {
+ console.error('打印入院证失败:', error);
+ ElMessage.error('打印入院证失败:' + (error.message || '未知错误'));
+ }
+};
+
getContract();
onMounted(() => {
getList();
@@ -321,6 +392,12 @@ const getList = () => {
queryParams.value.sortField = 'requestTime';
queryParams.value.sortOrder = 'DESC';
+ // 清除选中状态
+ selectedRow.value = null;
+ if (tableRef.value) {
+ tableRef.value.clearRadioRow();
+ }
+
getAdmissionPage(queryParams.value).then((res) => {
console.log('priceTypeList=======', JSON.stringify(priceTypeList.value));
let dataList = [];
diff --git a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/awaitList.vue b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/awaitList.vue
index b492c7b1e..e0d433bc5 100755
--- a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/awaitList.vue
+++ b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/awaitList.vue
@@ -60,6 +60,15 @@
{{ scope.row.age ? `${scope.row.age}岁` : '-' }}
+
+
+ 待登记
+
+