|
@@ -59,34 +59,42 @@
|
|
|
<el-button type="primary" icon="Printer" @click="execPrint">打印</el-button>
|
|
|
</template>
|
|
|
<template #main>
|
|
|
- <div style="display: flex; flex-wrap: wrap">
|
|
|
+ <div style="display: flex; flex-wrap: wrap" id="infusion_list">
|
|
|
<div v-if="queryParams.cardType === 'INFUSION_CARD'">
|
|
|
- <div
|
|
|
- v-for="item in patientInfusionInfos"
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-for="(item,index) in patientInfusionInfos"
|
|
|
:id="item.patInfo.patNo"
|
|
|
- style="margin: 8px 12px; padding: 4px; border: 1px solid red"
|
|
|
- >
|
|
|
- <infusion-card
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="crad-area"
|
|
|
+ style="width: 90%; margin: 8px 12px; padding: 4px; border: 1px solid red ;display: flex;justify-content: center; align-items: center;"
|
|
|
+ >
|
|
|
+ <infusion-card
|
|
|
:drug-groups="item.drugGroups"
|
|
|
:pat-info="item.patInfo"
|
|
|
:yz-date="queryParams.executeDate"
|
|
|
:print-date="printDate"
|
|
|
- >
|
|
|
- </infusion-card>
|
|
|
+ >
|
|
|
+ </infusion-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<div
|
|
|
+ class="crad-area"
|
|
|
v-for="(item,index) in patientInfusionInfos"
|
|
|
:id="item.patInfo.patNo+'-'+index"
|
|
|
- style="margin: 8px 12px"
|
|
|
+ style="margin: 0px 12px"
|
|
|
>
|
|
|
- <bottle-card
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <bottle-card
|
|
|
:drugs="item.bottleCardDrugs"
|
|
|
:pat-info="item.patInfo"
|
|
|
:yz-date="queryParams.executeDate"
|
|
|
- >
|
|
|
- </bottle-card>
|
|
|
+ >
|
|
|
+ </bottle-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -161,7 +169,7 @@ const handleTypeChange = () => {
|
|
|
|
|
|
const executeQuery = () => {
|
|
|
queryParams.executeDate = formatDate(queryParams.executeDate)
|
|
|
- queryParams.bedNos = []
|
|
|
+ queryParams.bedNos = []
|
|
|
patientBedList.value.forEach(bed => {
|
|
|
if (bed.sortNo >= queryParams.sortNoStart && bed.sortNo <= queryParams.sortNoEnd) {
|
|
|
queryParams.bedNos.push(bed.bedNo)
|
|
@@ -169,6 +177,9 @@ const executeQuery = () => {
|
|
|
})
|
|
|
queryInfusionCardOrBottleCard(queryParams).then(res => {
|
|
|
patientInfusionInfos.value = res
|
|
|
+ // for (let i = 0; i < 2; i++) {
|
|
|
+ // patientInfusionInfos.value = [...patientInfusionInfos.value, ...res]
|
|
|
+ // }
|
|
|
printDate.value = getDatetime()
|
|
|
}).catch(() => {
|
|
|
patientInfusionInfos.value = []
|
|
@@ -188,21 +199,59 @@ const execPrint = () => {
|
|
|
}
|
|
|
let LODOP = getLodop();
|
|
|
|
|
|
- const prntStyle = `<style>td{border: 1px solid black;font-size: 12px;padding: 2px;}</style>`
|
|
|
+ const prntStyle = `<style>td{border: 1px solid black;
|
|
|
+ font-size: 12px;padding: 2px;}</style>`
|
|
|
|
|
|
- let cardLength = patientInfusionInfos.value.length
|
|
|
- for (let i = 0; i < cardLength; i++) {
|
|
|
- let info = patientInfusionInfos.value[i]
|
|
|
- let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
- ? info.patInfo.patNo : info.patInfo.patNo + '-' + i
|
|
|
- const prntContent = document.getElementById(id).innerHTML
|
|
|
- let pagePrint = prntStyle + '<body>' + prntContent + '</body>'
|
|
|
- LODOP.PRINT_INIT('infusionCard')
|
|
|
- LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
- LODOP.ADD_PRINT_TABLE('0mm', '0mm', '210mm', '230mm', pagePrint)
|
|
|
- LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
- LODOP.PRINT()
|
|
|
- }
|
|
|
+ // let cardLength = patientInfusionInfos.value.length
|
|
|
+ // for (let i = 0; i < cardLength; i++) {
|
|
|
+ // let info = patientInfusionInfos.value[i]
|
|
|
+ // let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
+ // ? info.patInfo.patNo + 'a' + i : info.patInfo.patNo + '-' + i
|
|
|
+ // const prntContent = document.getElementById(id).innerHTML
|
|
|
+ // let pagePrint = prntStyle + '<body>' + prntContent + '</body>'
|
|
|
+ // LODOP.PRINT_INIT('infusionCard')
|
|
|
+ // LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
+ // LODOP.ADD_PRINT_TABLE('0mm', '0mm', '210mm', '230mm', pagePrint)
|
|
|
+ // LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
+ // LODOP.PREVIEW();
|
|
|
+ // // LODOP.PRINT()
|
|
|
+ // }
|
|
|
+ let prntContent = document.getElementById("infusion_list").innerHTML
|
|
|
+ // console.log("prntContent",prntContent)
|
|
|
+ let printHTML = ""
|
|
|
+ if(patientInfusionInfos.value.length == 1){
|
|
|
+ let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
+ ? patientInfusionInfos.value[0].patInfo.patNo : patientInfusionInfos.value[0].patInfo.patNo + '-' + i
|
|
|
+ printHTML = document.getElementById(id).innerHTML
|
|
|
+ LODOP.PRINT_INIT('infusionCard')
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
+ LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm',prntStyle + '<body style:"display: flex;justify-content: center;align-items: center;">' + printHTML + '</body>' )
|
|
|
+ LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
+ LODOP.PREVIEW();
|
|
|
+ } else {
|
|
|
+ for(let i = 0; i < patientInfusionInfos.value.length; i++){
|
|
|
+ let info = patientInfusionInfos.value[i]
|
|
|
+ let id = queryParams.cardType === 'INFUSION_CARD'
|
|
|
+ ? info.patInfo.patNo : info.patInfo.patNo + '-' + i
|
|
|
+ let printCount = queryParams.cardType === 'INFUSION_CARD'
|
|
|
+ ? 3 : 6
|
|
|
+ // console.log("printCount",printCount)
|
|
|
+ if(i !== 0 && ((i + 1) % printCount == 0 || i == patientInfusionInfos.value.length - 1)) {
|
|
|
+ // console.log("printHTML",printHTML)
|
|
|
+ // console.log("printIndex",i)
|
|
|
+ printHTML += document.getElementById(id).innerHTML
|
|
|
+ LODOP.PRINT_INIT('infusionCard')
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
+ LODOP.ADD_PRINT_HTML('0mm', '0mm', '210mm', '297mm',prntStyle + '<body style:"display: flex;justify-content: center;align-items: center;">' + printHTML + '</body>' )
|
|
|
+ LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
+ // LODOP.PREVIEW();
|
|
|
+ LODOP.PRINT()
|
|
|
+ printHTML = ""
|
|
|
+ } else {
|
|
|
+ printHTML += document.getElementById(id).innerHTML
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
updatePrintState()
|
|
|
}
|
|
|
|
|
@@ -264,4 +313,10 @@ onMounted(() => {
|
|
|
.is-disabled {
|
|
|
color: #a8abb2;
|
|
|
}
|
|
|
+.crad-area{
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|