浏览代码

修改打印单

张保健 6 年前
父节点
当前提交
1ff0f026a0
共有 2 个文件被更改,包括 50 次插入74 次删除
  1. 12 18
      src/xt_pages/dialysis/batch_print/batch_print_order_other.vue
  2. 38 56
      src/xt_pages/dialysis/dialysisPrintOrder.vue

+ 12 - 18
src/xt_pages/dialysis/batch_print/batch_print_order_other.vue 查看文件

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

+ 38 - 56
src/xt_pages/dialysis/dialysisPrintOrder.vue 查看文件

2233
   import LabelBox from './printItem/LabelBox'
2233
   import LabelBox from './printItem/LabelBox'
2234
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
2234
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
2235
   import DialysisPrintOrderTwo from './template/dialysisPrintOrderTwo'
2235
   import DialysisPrintOrderTwo from './template/dialysisPrintOrderTwo'
2236
-  import print from "print-js"
2237
-
2236
+  import print from 'print-js'
2238
 
2237
 
2239
   export default {
2238
   export default {
2240
     name: 'dialysisPrintOrder',
2239
     name: 'dialysisPrintOrder',
2306
         receiverTreatmentAccess: {},
2305
         receiverTreatmentAccess: {},
2307
         org_template_info: {},
2306
         org_template_info: {},
2308
 
2307
 
2309
-        doctor_advices:[],
2308
+        doctor_advices: [],
2310
         advice_groups: [],
2309
         advice_groups: [],
2311
 
2310
 
2312
         AlPanel: {
2311
         AlPanel: {
2516
 
2515
 
2517
             this.advice_jilurow = this.advices.length + 1
2516
             this.advice_jilurow = this.advices.length + 1
2518
 
2517
 
2519
-
2520
             var childMap = {}
2518
             var childMap = {}
2521
             for (const index in this.advices) {
2519
             for (const index in this.advices) {
2522
               if (this.advices[index].parent_id == 0) {
2520
               if (this.advices[index].parent_id == 0) {
2571
             }
2569
             }
2572
             this.loading = false
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
             for (let index = 0; index < this.doctor_advices.length; index++) {
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
               var initGroupBlock = function(group, advice) {
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
                   var doctor_advice = {
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
                   this.doctor_advices.splice(new_advice_index, 0, doctor_advice)
2600
                   this.doctor_advices.splice(new_advice_index, 0, doctor_advice)
2608
                   // this.doctor_advices.push(doctor_advice)
2601
                   // this.doctor_advices.push(doctor_advice)
2609
                 }
2602
                 }
2610
               }
2603
               }
2611
 
2604
 
2612
-
2613
-
2614
-
2615
               for (let index = 0; index < this.doctor_advices.length; index++) {
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
                 if (advice.groupno == 0) {
2607
                 if (advice.groupno == 0) {
2619
                   // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
2608
                   // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
2620
                   if (advice.parent_id > 0) {
2609
                   if (advice.parent_id > 0) {
2621
                     if (this.advice_groups.length > 0) {
2610
                     if (this.advice_groups.length > 0) {
2622
                       var parent_group = this.advice_groups[
2611
                       var parent_group = this.advice_groups[
2623
-                      this.advice_groups.length - 1
2624
-                        ];
2612
+                        this.advice_groups.length - 1
2613
+                      ]
2625
                       if (parent_group.advices.length > 0) {
2614
                       if (parent_group.advices.length > 0) {
2626
                         if (parent_group.advices[0].id == advice.parent_id) {
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
                   } else {
2621
                   } else {
2633
                     if (group.group_no > 0) {
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
                 if (group.group_no > 0 && group.group_no != advice.groupno) {
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
                 if (group.group_no == 0) {
2639
                 if (group.group_no == 0) {
2651
-                  initGroupBlock(group, advice);
2640
+                  initGroupBlock(group, advice)
2652
                 }
2641
                 }
2653
                 if (group.group_no == advice.groupno) {
2642
                 if (group.group_no == advice.groupno) {
2654
-                  group.advices.push(advice);
2643
+                  group.advices.push(advice)
2655
                 }
2644
                 }
2656
               }
2645
               }
2657
               if (group.group_no > 0) {
2646
               if (group.group_no > 0) {
2658
                 // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
2647
                 // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
2659
-                this.advice_groups.push(group);
2648
+                this.advice_groups.push(group)
2660
               }
2649
               }
2661
             }
2650
             }
2662
             console.log(this.advice_groups)
2651
             console.log(this.advice_groups)
2663
-
2664
-
2665
-
2666
-
2667
-
2668
-
2669
-
2670
           } else {
2652
           } else {
2671
             this.loading = false
2653
             this.loading = false
2672
             this.$message.error('请求数据失败')
2654
             this.$message.error('请求数据失败')
2707
             // exec_time: 0,
2689
             // exec_time: 0,
2708
             // checker: 0,
2690
             // checker: 0,
2709
           }
2691
           }
2710
-        );
2692
+        )
2711
       }
2693
       }
2712
     },
2694
     },
2713
     watch: {
2695
     watch: {