See999 4 years ago
parent
commit
89d06fd3cc
1 changed files with 25 additions and 5 deletions
  1. 25 5
      src/pages/main/template/DialysisPrintOrderThirteen.vue

+ 25 - 5
src/pages/main/template/DialysisPrintOrderThirteen.vue View File

@@ -52,7 +52,7 @@
52 52
           <div class="inline_block" style="margin-right:30px;">
53 53
             年龄:
54 54
             <div class="under_line" style="width: 50px;text-align: center">
55
-                {{ getAge(patientInfo) }}
55
+                {{ getNewAge(patientInfo.id_card_no) }}
56 56
             </div>
57 57
58 58
           </div>
@@ -534,6 +534,19 @@ export default {
534 534
     };
535 535
   },
536 536
   methods: {
537
+    getNewAge(UUserCard) {
538
+      if (UUserCard != null && UUserCard != '') {
539
+        //获取年龄
540
+        var myDate = new Date();
541
+        var month = myDate.getMonth() + 1;
542
+        var day = myDate.getDate();
543
+        var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
544
+        if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
545
+        age++;
546
+        }
547
+        return age;
548
+      }
549
+    },
537 550
     getDisplaceLiquiPart: function(val) {
538 551
       let displace_liqui_part_name = "/";
539 552
       const displace_liqui_part = this.displaceLiquiPartOptions;
@@ -594,10 +607,17 @@ export default {
594 607
     },
595 608
     getNumber() {
596 609
       if (this.dialysisOrder != null) {
597
-        return (
598
-          this.patientInfo.DialysisSchedule.device_zone.name +
599
-          this.dialysisOrder.DeviceNumber.number
600
-        );
610
+        if(this.patientInfo.DialysisSchedule.device_zone.name.indexOf("区") > -1){
611
+          return (
612
+            this.patientInfo.DialysisSchedule.device_zone.name +
613
+            this.dialysisOrder.DeviceNumber.number
614
+          );
615
+        } else {
616
+          return (
617
+            this.patientInfo.DialysisSchedule.device_zone.name + "区" +
618
+            this.dialysisOrder.DeviceNumber.number
619
+          );
620
+        }
601 621
       } else {
602 622
         return (
603 623
           this.patientInfo.DialysisSchedule.device_zone.name +