Jelajahi Sumber

打印处方单

zengfanwei 2 minggu lalu
induk
melakukan
461e2fd30e

+ 38 - 4
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -2717,6 +2717,15 @@ function printPrescription(patientId, times, orderNo) {
     });
 }
 
+function groupByGroupProperty(array) {
+    return array.reduce((acc, current) => {
+        const group = current.groupOrder;
+        acc[group] = acc[group] || [];
+        acc[group].push(current);
+        return acc;
+    }, {});
+}
+
 function printView(data) {
     $('.sjh').remove();
     $('#print_view input').attr("value", "");
@@ -2729,7 +2738,30 @@ function printView(data) {
         $("#age").attr("value", age);
     }
     var list = data.list;
-    console.log('list',list);
+    // console.log('list',list);
+    if(list.length > 0) {
+        let gruop = groupByGroupProperty(list);
+        for (const key in gruop) {
+            let current = gruop[key]
+            // console.log('current',current);
+            if (current) {
+                if(current.length == 1){
+                    current[0].groupSign = '⊐'
+                } else {
+                    current.forEach((item,index) => {
+                        if(index == 0) {
+                            item.groupSign = '⌝'
+                        } else if(index == current.length - 1) {
+                            item.groupSign = '⌟'
+                        } else {
+                            item.groupSign = ''
+                        }
+                    })
+                }
+            }
+        }
+        // console.log('gruop',gruop);
+    }
     if (age.substring(0, age.indexOf('岁')) < 18 && yf.xyFlag === '1') {
         $('#drugFlag').attr("value", "儿科");
         printIndex = ekCfPrintIndex;
@@ -2871,7 +2903,7 @@ function getXyPrintHtml(list) {
         var number = i + 1;
         let manufactoryName = list[i].manufactoryName == null || list[i].manufactoryName === '' ? '' : '(' + list[i].manufactoryName + ')';
         tr += '<tr>' +
-            '    <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' + number + "." +
+            '    <td style="margin-bottom: 5px;width: 10px;font-size: 18px;" align="left" valign="top">' + number + "." +
             '    </td>' +
             '    <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">' + tryResult + list[i].drugName +
             '    </td>' +
@@ -2882,14 +2914,16 @@ function getXyPrintHtml(list) {
             '    </td>' +
             '    <td style="margin-bottom: 5px;vertical-align: middle !important;width: 25px;text-align: left;font-size: 13px;">' + list[i].ypUnitName +
             '    </td>' +
+            '    <td style="vertical-align: middle !important;width: 25px;text-align: left;font-size:25px;font-weight: bold">' + list[i].groupSign +
+            '    </td>' +
             '</tr>' +
             '<tr>' +
             '    <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' +
             '    </td>' +
-            '    <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">' + '组&nbsp;&nbsp;(' + list[i].groupOrder + ')' + tryFlag +
-            '    </td>' +
             '    <td colspan="4" style="padding-left:0;margin-bottom: 5px;width:220px;vertical-align: middle !important;text-align: left;font-size: 13px;">用法:' + list[i].drugQuan + "&nbsp;" + list[i].drugUnitName + '/次&nbsp;&nbsp;' + list[i].frequencyName + '&nbsp;&nbsp;' + printName +
             '    </td>' +
+            '    <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">'  + tryFlag +
+            '    </td>' +
             '</tr>' +
             '<tr>' +
             '    <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' +

+ 3 - 1
src/main/resources/templates/mz/west_pharmacy_send.html

@@ -456,7 +456,7 @@
                                     </tbody>
                                 </table>
                             </div>
-                            <div id="zbr_div" style="position: absolute;top:620px; ">
+                            <div id="zbr_div" style="position: absolute;top:600px; ">
                                 <div style="margin-bottom: 5px;margin-top: 10px;">
                                     <span style="font-size: 12px;">医&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;师:</span>
                                     <span style="display:inline-block;font-size: 12px;border-top: 0;border-left: 0;border-right: 0;border-bottom: 1px solid;width: 120px;background-color: white;color: black;"
@@ -465,6 +465,8 @@
                                     <span style="display:inline-block;font-size: 12px;border-top: 0;border-left: 0;border-right: 0;border-bottom: 1px solid;width: 120px;background-color: white;color: black;"
                                           disabled id="totalPrice"></span>
                                     <br/>
+                                    <br/>
+<!--                                    <br/>-->
 <!--                                    <span style="font-size: 12px;">审核药师:</span>-->
 <!--                                    <span style="display:inline-block;font-size: 12px;border-top: 0;border-left: 0;border-right: 0;border-bottom: 1px solid;width: 120px;background-color: white;color: black;"-->
 <!--                                          disabled id="shName"></span>-->