|
@@ -21,7 +21,7 @@ import {
|
|
|
import {getLodop, initLodop} from "@/utils/c-lodop";
|
|
|
import PageLayer from "@/layout/PageLayer.vue";
|
|
|
import router from "@/router";
|
|
|
-import {isDev} from "@/utils/public";
|
|
|
+import {isDev, nullToEmpty} from "@/utils/public";
|
|
|
import BloodSugarTable from "@/views/examination/BloodSugarQuery/components/BloodSugarTable.vue";
|
|
|
import Dig from "@/utils/math";
|
|
|
|
|
@@ -45,8 +45,6 @@ const queryPatientSBloodSugarInformation = () => {
|
|
|
data = res.bloodSugarData
|
|
|
patientInfo = res.patientInfo
|
|
|
page.totalPage = Math.ceil(Dig.division(data.length, page.pageSize))
|
|
|
-
|
|
|
- console.log(res)
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -60,72 +58,199 @@ const tempData = computed(() => {
|
|
|
})
|
|
|
|
|
|
const printDiv = ref(null)
|
|
|
-
|
|
|
+let thead = ["空腹", "早餐后", "中餐前", "中餐后", "晚餐前", "晚餐后", "零点", "三点", "随机血糖1", "随机血糖2", "随机血糖3"]
|
|
|
+const htmlTd = (index, data) => {
|
|
|
+ return data[thead[index]]
|
|
|
+}
|
|
|
const print = () => {
|
|
|
- let LODOP = getLodop()
|
|
|
- let style = `<style>
|
|
|
+ let trStr = ''
|
|
|
+ for (let i = 0, len = data.length; i < len; i++) {
|
|
|
+ let item = data[i]
|
|
|
+ let childStr = ``
|
|
|
|
|
|
- table {
|
|
|
- font-size: 9pt;
|
|
|
- table-layout:fixed;word-break:break-all;
|
|
|
- }
|
|
|
+ for (let j = 0; j < 11; j++) {
|
|
|
+ let childItem = htmlTd(j, item.data)
|
|
|
+ childStr += `
|
|
|
+ <td>
|
|
|
+ ${nullToEmpty(childItem?.formatTestTime)}
|
|
|
+ <div style="border-top: 1px solid #000;width: 100%;margin-bottom: 3px"/>
|
|
|
+ ${nullToEmpty(childItem?.testResult)}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${nullToEmpty(childItem?.nurseIdName)}
|
|
|
+ </td>
|
|
|
+ `
|
|
|
+ }
|
|
|
|
|
|
-td {
|
|
|
- border: 0.75pt solid #000;
|
|
|
- text-align: center;
|
|
|
- padding: 7.5pt 0;
|
|
|
-}
|
|
|
+ trStr += `
|
|
|
+ <tr style="padding: 7.5pt;">
|
|
|
+ <td>${item.date}</td>
|
|
|
+ ${childStr}
|
|
|
+ </tr>
|
|
|
+ `
|
|
|
+ }
|
|
|
+ let a = `
|
|
|
+<table style="width: 100%;">
|
|
|
+ <thead>
|
|
|
+ <tr class="no_border">
|
|
|
+ <th colspan="23">长沙泰和医院</th>
|
|
|
+ </tr>
|
|
|
+ <tr class="no_border">
|
|
|
+ <th colspan="3">
|
|
|
+ 姓名:${nullToEmpty(patientInfo?.name)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 性别:${nullToEmpty(patientInfo?.sexName)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 年龄:${nullToEmpty(patientInfo?.age)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 科室:${nullToEmpty(patientInfo?.zkWardName)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 床号:${nullToEmpty(patientInfo?.bedNo)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 住院号: ${nullToEmpty(patientInfo?.inpatientNo)}
|
|
|
+ </th>
|
|
|
+ <th colspan="3">
|
|
|
+ 单位:mmol/L
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style="min-width:70.5pt" rowspan="2">日期</th>
|
|
|
+ <th colspan="2">
|
|
|
+ 空腹
|
|
|
+ </th>
|
|
|
|
|
|
-.tr th {
|
|
|
- border: 0.75pt solid #000;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
+ <th colspan="2">
|
|
|
+ 早餐后
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 中餐前
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 中餐后
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 晚餐前
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 晚餐后
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 零点
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 三点
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 随机血糖1
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 随机血糖2
|
|
|
+ </th>
|
|
|
+ <th colspan="2">
|
|
|
+ 随机血糖3
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
|
|
|
-select{
|
|
|
- appearance: none;
|
|
|
- border: none;
|
|
|
- -webkit-appearance: none;
|
|
|
-}
|
|
|
+ <tr>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 时间
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ 签名
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ ${trStr}
|
|
|
+ </tbody>
|
|
|
|
|
|
-table, tr, td {
|
|
|
- border-collapse: collapse;
|
|
|
- word-break: break-all;
|
|
|
-}</style>`
|
|
|
-
|
|
|
- LODOP.PRINT_INIT('泰和医院内分泌科血糖单') // 初始化打印机 名字
|
|
|
- LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') // 设置纸张大小 A4
|
|
|
- LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) // 整宽不变形
|
|
|
-
|
|
|
- for (let i = 1, len = page.totalPage + 1; i < len; i++) {
|
|
|
- let temp = data.slice((i - 1) * page.pageSize, page.pageSize * i);
|
|
|
- const table = createApp(BloodSugarTable, {
|
|
|
- patientInfo: patientInfo,
|
|
|
- data: temp,
|
|
|
- page: {
|
|
|
- total: page.total,
|
|
|
- currentPage: i,
|
|
|
- totalPage: page.totalPage,
|
|
|
- pageSize: page.pageSize
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- const parentNode = document.createElement('div')
|
|
|
- document.body.appendChild(parentNode)
|
|
|
- table.mount(parentNode)
|
|
|
- parentNode.style.width = '841.5pt'
|
|
|
- parentNode.style.height = '793px'
|
|
|
-
|
|
|
- const strHtml = style + '<body>' + parentNode.innerHTML + '</body>'
|
|
|
- LODOP.ADD_PRINT_HTM('2mm', '5mm', '100%', '100%', strHtml) //要打印的内容
|
|
|
- table.unmount()
|
|
|
- document.body.removeChild(parentNode)
|
|
|
- if (i !== len) {
|
|
|
- LODOP.NewPage();
|
|
|
- }
|
|
|
- }
|
|
|
+ <tfoot>
|
|
|
+ <tr colspan="23">
|
|
|
+ <td colspan="23">
|
|
|
+ 共 ${page.total} 条
|
|
|
+ 当前第 <span tdata="pageNO" format="#">#</span>页
|
|
|
+ /共 <span tdata="pageCount" format="#">##</span>页
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tfoot>
|
|
|
+ </table>
|
|
|
+ `
|
|
|
+ const LODOP = getLodop();
|
|
|
+ LODOP.PRINT_INIT("血糖");
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(2, '210mm', '297mm', '')
|
|
|
+
|
|
|
+ LODOP.SET_PRINT_MODE('RESELECT_PRINTER', true)
|
|
|
+ LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width')
|
|
|
+ LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1)
|
|
|
|
|
|
- LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
- LODOP.PREVIEW() // 关闭
|
|
|
+ const strStyle = "<style>.no_border th{border:0;}td{border:0.75pt solid #000;text-align:center;padding:0;}thead th{border:0.75pt solid #000;}tbody th{border:0.75pt solid #000;text-align:center;}table,tr,td{border-collapse:collapse;}</style>";
|
|
|
+ LODOP.ADD_PRINT_TABLE('2mm', '5mm', '100%', '100%', strStyle + a);
|
|
|
+ LODOP.PREVIEW();
|
|
|
}
|
|
|
|
|
|
|