Browse Source

修改打印单

张保健 6 years ago
parent
commit
1ff0f026a0

+ 12 - 18
src/xt_pages/dialysis/batch_print/batch_print_order_other.vue View File

@@ -959,7 +959,7 @@
959 959
   import { jsGetAge, uParseTime } from '@/utils/tools'
960 960
   import { getDataConfig } from '@/utils/data'
961 961
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
962
-  import print from "print-js"
962
+  import print from 'print-js'
963 963
   export default {
964 964
     name: 'BatchPrintOrder',
965 965
     components: {
@@ -1035,10 +1035,9 @@
1035 1035
       GetBatchPrintDialysisData(ids.join(',')).then(rs => {
1036 1036
         var resp = rs.data
1037 1037
         if (resp.state == 1) {
1038
-
1039 1038
           this.records = this.records.concat(resp.data.schedules)
1040 1039
           for (const recordIndex in this.records) {
1041
-            this.advice_groups =[]
1040
+            this.advice_groups = []
1042 1041
             var dlegh = 0
1043 1042
             if (this.records[recordIndex].monitor_records && this.records[recordIndex].monitor_records.length < 8) {
1044 1043
               dlegh = 10 - this.records[recordIndex].monitor_records.length
@@ -1046,7 +1045,7 @@
1046 1045
               dlegh = 10
1047 1046
             }
1048 1047
             if (dlegh > 0) {
1049
-              if (typeof (this.records[recordIndex].monitor_records) == 'undefined' || this.records[recordIndex].monitor_records == null) {
1048
+              if (typeof (this.records[recordIndex].monitor_records) === 'undefined' || this.records[recordIndex].monitor_records == null) {
1050 1049
                 this.records[recordIndex].monitor_records = []
1051 1050
               }
1052 1051
               for (let index = 0; index < dlegh; index++) {
@@ -1065,9 +1064,6 @@
1065 1064
               childMap[this.records[recordIndex].advices[index].parent_id].push(this.records[recordIndex].advices[index])
1066 1065
             }
1067 1066
 
1068
-
1069
-
1070
-
1071 1067
             var advices = []
1072 1068
             for (const index in this.records[recordIndex].advices) {
1073 1069
               if (this.records[recordIndex].advices[index].parent_id > 0) {
@@ -1104,7 +1100,7 @@
1104 1100
                     id: this.doctor_advices[index].id,
1105 1101
                     parent_id: this.doctor_advices[index].parent_id,
1106 1102
                     children: this.doctor_advices[index].children,
1107
-                    remark:this.doctor_advices[index].remark,
1103
+                    remark: this.doctor_advices[index].remark
1108 1104
 
1109 1105
                   }
1110 1106
                   doctor_advice['isShow'] = 1
@@ -1112,7 +1108,6 @@
1112 1108
                 }
1113 1109
               }
1114 1110
 
1115
-
1116 1111
               for (let index = 0; index < this.doctor_advices.length; index++) {
1117 1112
                 const advice = this.doctor_advices[index]
1118 1113
                 if (advice.groupno == 0) {
@@ -1120,8 +1115,8 @@
1120 1115
                   if (advice.parent_id > 0) {
1121 1116
                     if (this.advice_groups.length > 0) {
1122 1117
                       var parent_group = this.advice_groups[
1123
-                      this.advice_groups.length - 1
1124
-                        ]
1118
+                        this.advice_groups.length - 1
1119
+                      ]
1125 1120
                       if (parent_group.advices.length > 0) {
1126 1121
                         if (parent_group.advices[0].id == advice.parent_id) {
1127 1122
                           parent_group.advices.push(advice)
@@ -1174,7 +1169,6 @@
1174 1169
 
1175 1170
           this.adminUser = resp.data.users
1176 1171
           this.loading = false
1177
-
1178 1172
         } else {
1179 1173
           this.loading = false
1180 1174
           this.$message.error(resp.msg)
@@ -1202,7 +1196,7 @@
1202 1196
       },
1203 1197
 
1204 1198
       complicationsOther: function(record) {
1205
-        if (record == null || typeof (record) == 'undefined') {
1199
+        if (record == null || typeof (record) === 'undefined') {
1206 1200
           return ''
1207 1201
         }
1208 1202
         if (record.complication.length == 0) {
@@ -1224,7 +1218,7 @@
1224 1218
         return ''
1225 1219
       },
1226 1220
       anticoagulantName: function(key) {
1227
-        if (key == null || typeof (key) == 'undefined') {
1221
+        if (key == null || typeof (key) === 'undefined') {
1228 1222
           return ''
1229 1223
         }
1230 1224
         var id = key.anticoagulant
@@ -1234,7 +1228,7 @@
1234 1228
         return ''
1235 1229
       },
1236 1230
       isBbloodAccessParOperaCheck(key, value) {
1237
-        if (key == null || typeof (key) == 'undefined') {
1231
+        if (key == null || typeof (key) === 'undefined') {
1238 1232
           return false
1239 1233
         }
1240 1234
         var id = key.blood_access_part_opera_id
@@ -1244,7 +1238,7 @@
1244 1238
         return false
1245 1239
       },
1246 1240
       isdialysateFormulatioCheck(key, value) {
1247
-        if (key == null || typeof (key) == 'undefined') {
1241
+        if (key == null || typeof (key) === 'undefined') {
1248 1242
           return false
1249 1243
         }
1250 1244
         var id = key.dialysate_formulation
@@ -1261,7 +1255,7 @@
1261 1255
         }
1262 1256
       },
1263 1257
       setAdminUserES(key, id) {
1264
-        if (typeof (key) == 'undefined' || key == null || typeof (key[id]) == 'undefined') {
1258
+        if (typeof (key) === 'undefined' || key == null || typeof (key[id]) === 'undefined') {
1265 1259
           return ''
1266 1260
         }
1267 1261
         if (key[id] == 0) {
@@ -1274,7 +1268,7 @@
1274 1268
         }
1275 1269
       },
1276 1270
       getAdminUser(key, id) {
1277
-        if (typeof (key) == 'undefined' || key == null || typeof (key[id]) == 'undefined') {
1271
+        if (typeof (key) === 'undefined' || key == null || typeof (key[id]) === 'undefined') {
1278 1272
           return ''
1279 1273
         }
1280 1274
         if (key[id] == 0) {

+ 38 - 56
src/xt_pages/dialysis/dialysisPrintOrder.vue View File

@@ -2233,8 +2233,7 @@
2233 2233
   import LabelBox from './printItem/LabelBox'
2234 2234
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
2235 2235
   import DialysisPrintOrderTwo from './template/dialysisPrintOrderTwo'
2236
-  import print from "print-js"
2237
-
2236
+  import print from 'print-js'
2238 2237
 
2239 2238
   export default {
2240 2239
     name: 'dialysisPrintOrder',
@@ -2306,7 +2305,7 @@
2306 2305
         receiverTreatmentAccess: {},
2307 2306
         org_template_info: {},
2308 2307
 
2309
-        doctor_advices:[],
2308
+        doctor_advices: [],
2310 2309
         advice_groups: [],
2311 2310
 
2312 2311
         AlPanel: {
@@ -2516,7 +2515,6 @@
2516 2515
 
2517 2516
             this.advice_jilurow = this.advices.length + 1
2518 2517
 
2519
-
2520 2518
             var childMap = {}
2521 2519
             for (const index in this.advices) {
2522 2520
               if (this.advices[index].parent_id == 0) {
@@ -2571,102 +2569,86 @@
2571 2569
             }
2572 2570
             this.loading = false
2573 2571
 
2574
-
2575
-
2576
-
2577
-
2578
-            this.doctor_advices =  response.data.data.advices == null ? [] :  response.data.data.advices
2572
+            this.doctor_advices = response.data.data.advices == null ? [] : response.data.data.advices
2579 2573
 
2580 2574
             for (let index = 0; index < this.doctor_advices.length; index++) {
2581
-               this.doctor_advices[index]['isShow'] = 2
2575
+              this.doctor_advices[index]['isShow'] = 2
2582 2576
             }
2583 2577
 
2584
-
2585
-              if (this.doctor_advices.length > 0) {
2586
-              var group = this.newAdviceGroupObject();
2578
+            if (this.doctor_advices.length > 0) {
2579
+              var group = this.newAdviceGroupObject()
2587 2580
               var initGroupBlock = function(group, advice) {
2588
-                group.group_no = advice.groupno;
2589
-              };
2590
-                for (let index = this.doctor_advices.length-1; index >= 0; index--) {
2591
-                var new_advice_index = 0;
2581
+                group.group_no = advice.groupno
2582
+              }
2583
+              for (let index = this.doctor_advices.length - 1; index >= 0; index--) {
2584
+                var new_advice_index = 0
2592 2585
 
2593
-                  if('children' in this.doctor_advices[index]  && this.doctor_advices[index].children.length > 0){
2594
-                  new_advice_index = index+this.doctor_advices[index].children.length+1
2586
+                if ('children' in this.doctor_advices[index] && this.doctor_advices[index].children.length > 0) {
2587
+                  new_advice_index = index + this.doctor_advices[index].children.length + 1
2595 2588
 
2596 2589
                   var doctor_advice = {
2597
-                    delivery_way:this.doctor_advices[index].delivery_way,
2598
-                    execution_frequency:this.doctor_advices[index].execution_frequency,
2599
-                    groupno:this.doctor_advices[index].groupno,
2600
-                    id:this.doctor_advices[index].id,
2601
-                    parent_id:this.doctor_advices[index].parent_id,
2602
-                    children:this.doctor_advices[index].children,
2603
-                    remark:this.doctor_advices[index].remark,
2590
+                    delivery_way: this.doctor_advices[index].delivery_way,
2591
+                    execution_frequency: this.doctor_advices[index].execution_frequency,
2592
+                    groupno: this.doctor_advices[index].groupno,
2593
+                    id: this.doctor_advices[index].id,
2594
+                    parent_id: this.doctor_advices[index].parent_id,
2595
+                    children: this.doctor_advices[index].children,
2596
+                    remark: this.doctor_advices[index].remark
2604 2597
 
2605 2598
                   }
2606
-                  doctor_advice['isShow'] =1
2599
+                  doctor_advice['isShow'] = 1
2607 2600
                   this.doctor_advices.splice(new_advice_index, 0, doctor_advice)
2608 2601
                   // this.doctor_advices.push(doctor_advice)
2609 2602
                 }
2610 2603
               }
2611 2604
 
2612
-
2613
-
2614
-
2615 2605
               for (let index = 0; index < this.doctor_advices.length; index++) {
2616
-
2617
-                const advice = this.doctor_advices[index];
2606
+                const advice = this.doctor_advices[index]
2618 2607
                 if (advice.groupno == 0) {
2619 2608
                   // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
2620 2609
                   if (advice.parent_id > 0) {
2621 2610
                     if (this.advice_groups.length > 0) {
2622 2611
                       var parent_group = this.advice_groups[
2623
-                      this.advice_groups.length - 1
2624
-                        ];
2612
+                        this.advice_groups.length - 1
2613
+                      ]
2625 2614
                       if (parent_group.advices.length > 0) {
2626 2615
                         if (parent_group.advices[0].id == advice.parent_id) {
2627
-                          parent_group.advices.push(advice);
2616
+                          parent_group.advices.push(advice)
2628 2617
                         }
2629 2618
                       }
2630 2619
                     }
2631
-                    continue;
2620
+                    continue
2632 2621
                   } else {
2633 2622
                     if (group.group_no > 0) {
2634
-                      this.advice_groups.push(group);
2635
-                      group = this.newAdviceGroupObject();
2623
+                      this.advice_groups.push(group)
2624
+                      group = this.newAdviceGroupObject()
2636 2625
                     }
2637 2626
 
2638
-                    initGroupBlock(group, advice);
2639
-                    group.advices.push(advice);
2640
-                    this.advice_groups.push(group);
2641
-                    group = this.newAdviceGroupObject();
2642
-                    continue;
2627
+                    initGroupBlock(group, advice)
2628
+                    group.advices.push(advice)
2629
+                    this.advice_groups.push(group)
2630
+                    group = this.newAdviceGroupObject()
2631
+                    continue
2643 2632
                   }
2644 2633
                 }
2645 2634
 
2646 2635
                 if (group.group_no > 0 && group.group_no != advice.groupno) {
2647
-                  this.advice_groups.push(group);
2648
-                  group = this.newAdviceGroupObject();
2636
+                  this.advice_groups.push(group)
2637
+                  group = this.newAdviceGroupObject()
2649 2638
                 }
2650 2639
                 if (group.group_no == 0) {
2651
-                  initGroupBlock(group, advice);
2640
+                  initGroupBlock(group, advice)
2652 2641
                 }
2653 2642
                 if (group.group_no == advice.groupno) {
2654
-                  group.advices.push(advice);
2643
+                  group.advices.push(advice)
2655 2644
                 }
2656 2645
               }
2657 2646
               if (group.group_no > 0) {
2658 2647
                 // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
2659
-                this.advice_groups.push(group);
2648
+                this.advice_groups.push(group)
2660 2649
               }
2661 2650
             }
2662 2651
             console.log(this.advice_groups)
2663
-
2664
-
2665
-
2666
-
2667
-
2668
-
2669
-
2670 2652
           } else {
2671 2653
             this.loading = false
2672 2654
             this.$message.error('请求数据失败')
@@ -2707,7 +2689,7 @@
2707 2689
             // exec_time: 0,
2708 2690
             // checker: 0,
2709 2691
           }
2710
-        );
2692
+        )
2711 2693
       }
2712 2694
     },
2713 2695
     watch: {