Browse Source

打印医嘱

yeguodong 2 months ago
parent
commit
4d9567a51a

+ 3 - 2
src/data/index.js

@@ -330,7 +330,8 @@ export const infnos = {
         {code: '2405', name: '撤销出院办理'},
         {code: '2304', name: '出院结算'},
         {code: '2305', name: '撤销出院结算'},
-        {code: '4101', name: '结算清单上传'},
+        {code: '4101A', name: '结算清单上传'},
+        {code: '4401', name: '病案首页上传'},
         {code: '100003', name: '分组接口'},
         {code: '100002', name: '质控接口'},
     ],
@@ -339,7 +340,7 @@ export const infnos = {
         {code: '2504', name: '撤销慢特病备案'},
         {code: '2201', name: '门诊挂号'},
         {code: '2202', name: '撤销门诊挂号'},
-        {code: '2203', name: '就诊信息上传'},
+        {code: '2203A', name: '就诊信息上传'},
         {code: '2204', name: '处方明细上传'},
         {code: '2205', name: '撤销处方明细上传'},
         {code: '2206', name: '门诊预结算'},

+ 35 - 2
src/views/medical-advice/advice-management/CqYzPrint.vue

@@ -16,10 +16,10 @@
             <el-button icon="Search" type="primary" @click="queryInfo"
               >查询</el-button
             >
-            <el-button icon="Printer" type="success" @click="daYingClick"
+            <el-button icon="Printer" type="success" @click="print(false)"
               >打印预览</el-button
             >
-            <el-button icon="Printer" type="success" @click="printClick"
+            <el-button icon="Printer" type="success" @click="print(true)"
               >打印</el-button
             >
           </el-col>
@@ -315,6 +315,39 @@ const printClick = () => {
   LODOP.PRINT(); // 关闭
   queryInfo();
 };
+
+const print = (type) => {
+    // 获取要打印的元素
+    const printContent = document.getElementById('cqYz');
+
+    if (!printContent) {
+        console.error('未找到id为cqYz的元素');
+        return;
+    }
+
+    // 创建打印窗口
+    const printWindow = window.open('', '_blank');
+
+    // 复制文档头部信息(确保样式生效)
+    printWindow.document.head.innerHTML = document.head.innerHTML;
+
+    // 创建打印区域
+    printWindow.document.body.innerHTML = `
+    <div class="print-container">
+      ${printContent.outerHTML}
+    </div>
+  `;
+
+    console.log("type", type)
+    if(type) {
+        setTimeout(() => {
+            printWindow.print();
+            // 打印后关闭窗口
+            printWindow.close();
+        }, 100);
+    }
+
+};
 </script>
 
 <style scoped>

+ 36 - 2
src/views/medical-advice/advice-management/LsYzPrint.vue

@@ -16,10 +16,10 @@
             <el-button icon="Search" type="primary" @click="queryInfo"
               >查询</el-button
             >
-            <el-button icon="Printer" type="success" @click="daYingClick"
+            <el-button icon="Printer" type="success" @click="print(false)"
               >打印预览</el-button
             >
-            <el-button icon="Printer" type="success" @click="printClick"
+            <el-button icon="Printer" type="success" @click="print(true)"
               >打印</el-button
             >
           </el-col>
@@ -303,6 +303,40 @@ const printClick = () => {
   LODOP.PRINT(); // 关闭
   queryInfo();
 };
+
+const print = (type) => {
+    // 获取要打印的元素
+    const printContent = document.getElementById('cqYz');
+
+    if (!printContent) {
+        console.error('未找到id为cqYz的元素');
+        return;
+    }
+
+    // 创建打印窗口
+    const printWindow = window.open('', '_blank');
+
+    // 复制文档头部信息(确保样式生效)
+    printWindow.document.head.innerHTML = document.head.innerHTML;
+
+    // 创建打印区域
+    printWindow.document.body.innerHTML = `
+    <div class="print-container">
+      ${printContent.outerHTML}
+    </div>
+  `;
+
+    // 等待内容加载完成后执行打印
+    if(type) {
+        setTimeout(() => {
+            printWindow.print();
+            // 打印后关闭窗口
+            printWindow.close();
+        }, 100);
+    }
+
+};
+
 </script>
 
 <style scoped>