|
@@ -3,8 +3,8 @@
|
|
|
纸张:
|
|
|
<el-radio v-model="zhiZhang" :label="1" size="large">A4</el-radio>
|
|
|
<el-radio v-model="zhiZhang" :label="2" size="large">A5</el-radio>
|
|
|
- <el-button @click="daYing">打印</el-button>
|
|
|
- <div id="daYing">
|
|
|
+ <el-button @click="printClick">打印</el-button>
|
|
|
+ <div ref="printRef">
|
|
|
<div style="width:393pt;height:570pt;background-color: white;font-size: 9.75pt">
|
|
|
<div style="height: 15pt"></div>
|
|
|
<table style="width: 100%;table-layout: fixed;">
|
|
@@ -103,7 +103,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name="DaYingShouShuShengQingDan">
|
|
|
+<script setup lang="ts">
|
|
|
import {computed, onMounted, ref} from "vue";
|
|
|
import {cptSex} from "@/utils/computed";
|
|
|
import {getLodop, initLodop} from "@/utils/c-lodop";
|
|
@@ -123,6 +123,35 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+interface OpRecord {
|
|
|
+ recordId?: string
|
|
|
+ deptCodeName?: string
|
|
|
+ inpatientNo?: string
|
|
|
+ bedNo?: string
|
|
|
+ patientName?: string
|
|
|
+ sex?: string
|
|
|
+ age?: string
|
|
|
+ diagBeforeOp?: string
|
|
|
+ opName?: string
|
|
|
+ hocusName?: string
|
|
|
+ opScaleName?: string
|
|
|
+ doctorZdName?: string
|
|
|
+ doctor1Name?: string
|
|
|
+ doctor2Name?: string
|
|
|
+ doctor3Name?: string
|
|
|
+ doctorMzName?: string
|
|
|
+ nurseQxName?: string
|
|
|
+ nurseXhName?: string
|
|
|
+ applyDate?: string
|
|
|
+ opDatetime?: string
|
|
|
+ referPhysicianName?: string
|
|
|
+ deptDirectorName?: string
|
|
|
+ urgentClinicFlag?: string
|
|
|
+ remark?: string
|
|
|
+}
|
|
|
+
|
|
|
+const printRef = ref<HTMLDivElement>()
|
|
|
+
|
|
|
const zuJianDaXiao = computed(() => {
|
|
|
return {
|
|
|
width: props.width + 'px',
|
|
@@ -131,7 +160,7 @@ const zuJianDaXiao = computed(() => {
|
|
|
}
|
|
|
})
|
|
|
const zhiZhang = ref(2)
|
|
|
-const data = ref({})
|
|
|
+const data = ref<OpRecord>({})
|
|
|
const css = '*{font-size:12pt}.tanXingHeZiHeng{display:flex;justify-content:space-between;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiHeng2{display:flex;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiShu{display:flex;flex-direction:column}.wen-zi{display:flex;margin-top:3pt;margin-left:3.75pt;height:23.75pt}.wen-zi div:first-child{display:flex;flex-direction:row;justify-content:center;text-align:right}.wen-zi div:nth-child(2){margin-left:3pt;display:table}.ge-zi{display:table-column}'
|
|
|
|
|
|
const situationFunc = () => {
|
|
@@ -142,15 +171,13 @@ const situationFunc = () => {
|
|
|
return findValueByListCode(surgicalSituation, data.value.urgentClinicFlag)
|
|
|
}
|
|
|
|
|
|
-const daYing = () => {
|
|
|
+const printClick = () => {
|
|
|
if (!data) {
|
|
|
return ElMessage.error('请先选择患者')
|
|
|
}
|
|
|
-
|
|
|
- let LODOP = getLodop()
|
|
|
- const strFormHtml = '<style>' + css + '</style>' + '<body>' + document.getElementById('daYing').innerHTML + '</body>';
|
|
|
+ let LODOP = getLodop();
|
|
|
+ const strFormHtml = '<style>' + css + '</style>' + '<body>' + printRef.value.innerHTML + '</body>';
|
|
|
LODOP.PRINT_INIT(0, 0, 522, 333, '检查申请') // 初始化打印机 名字
|
|
|
- // LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Width");
|
|
|
// 整宽不变形
|
|
|
if (zhiZhang.value === 1) {
|
|
|
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') // 设置纸张大小 A
|
|
@@ -158,17 +185,19 @@ const daYing = () => {
|
|
|
LODOP.SET_PRINT_PAGESIZE(1, 0, 0, 'A5')
|
|
|
}
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strFormHtml) // 参数分别为顶边距,左边距,宽,高,打印项内容。
|
|
|
- // LODOP.PRINT_DESIGN()
|
|
|
LODOP.PREVIEW() // 关闭
|
|
|
}
|
|
|
|
|
|
+const setData = (val) => {
|
|
|
+ data.value = val
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
initLodop()
|
|
|
})
|
|
|
|
|
|
defineExpose({
|
|
|
- daYing,
|
|
|
- data
|
|
|
+ setData
|
|
|
})
|
|
|
|
|
|
</script>
|