huangyw 2 years ago
parent
commit
3b9170301d
1 changed files with 20 additions and 2 deletions
  1. 20 2
      src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue

+ 20 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue View File

@@ -2698,8 +2698,26 @@ export default {
2698 2698
     getoldAge(){
2699 2699
       let date = new Date()
2700 2700
       let year = date.getFullYear()
2701
+      // let year = 2034
2701 2702
       let year_d = year-this.xtdate.split('-')[0]
2702
-      return year_d
2703
+      let year_m = this.xtdate.split('-')[1]
2704
+      let birth_m = this.patientInfo.birth.split('-')[1]
2705
+      let year_date = this.xtdate.split('-')[2]
2706
+      let birth_date = this.patientInfo.birth.split('-')[2]
2707
+      // console.log(year,'今年年月')
2708
+      // console.log(this.xtdate.split('-'),'病人就诊年月')
2709
+      // console.log(this.patientInfo.birth,'病人生日')
2710
+      if(year_m < birth_m){
2711
+        return year_d - 1
2712
+      }else if(year_m = birth_m){
2713
+        if(year_date < birth_date){
2714
+          return year_d - 1
2715
+        }else{
2716
+          return year_d
2717
+        }
2718
+      }else{
2719
+        return year_d
2720
+      }
2703 2721
     },
2704 2722
 
2705 2723
 
@@ -3451,7 +3469,7 @@ export default {
3451 3469
           return val.age;
3452 3470
         }
3453 3471
       } else {
3454
-        return jsGetAge(val.birth, "-");
3472
+        return this.getoldAge()
3455 3473
       }
3456 3474
     },
3457 3475
     newAdviceGroupObject: function () {