Bläddra i källkod

护理看板数据源以及输液打印更改

zengfanwei 1 månad sedan
förälder
incheckning
239f8332af

+ 10 - 5
src/components/nursing-dashboard/RenderTable.vue

@@ -191,8 +191,8 @@ const startScroll = () => {
   scrollTimer.value = setInterval(() => {
     const parentHeight = containerRef.value.clientHeight;
     const childHeight = divRef.value.scrollHeight;
-    const scrollHeight = childHeight - parentHeight;
-    if (containerRef.value.scrollTop == scrollHeight) {
+    let scrollHeight = childHeight - parentHeight;
+    if (Math.abs(containerRef.value.scrollTop - scrollHeight) < 1) {
       clearInterval(scrollTimer.value);
       time1.value = setTimeout(() => {
         containerRef.value.scrollTop = 0;
@@ -202,10 +202,15 @@ const startScroll = () => {
           }, 2000);
         }
       }, 2000);
-      console.log(222);
+      // console.log(222);
+      // substring
     } else {
-      console.log(333);
-      containerRef.value.scrollTop += scrollHeight / 2;
+      // console.log(333);
+      // console.log("scrollHeight",scrollHeight);
+      const remaining = scrollHeight - containerRef.value.scrollTop;
+      const increment = Math.min(50, remaining); // 不超过剩余距离
+      containerRef.value.scrollTop = Math.ceil(containerRef.value.scrollTop + increment);
+      // console.log("scrollTop2",containerRef.value.scrollTop);
     }
   }, 2000);
   //

+ 82 - 27
src/views/hospitalization/nurse-module/PrintInfusionCard.vue

@@ -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>

+ 2 - 2
src/views/single-page/InpatientBoardV2/BoardInfo.vue

@@ -198,7 +198,7 @@ const store = inject(InpatientBoardKey) as InpatientBoardType;
     }
 
     .bottom-area-2 {
-      width: 42%;
+      width: 40%;
       display: flex;
       align-items: center;
       justify-content: center;
@@ -215,7 +215,7 @@ const store = inject(InpatientBoardKey) as InpatientBoardType;
     }
 
     .bottom-area-3 {
-      width: 28%;
+      width: 30%;
       display: flex;
       justify-content: center;
       align-items: center;