Browse Source

Merge remote-tracking branch 'origin/20230223_pc_vue_new_branch' into 20230223_pc_vue_new_branch

yq1 3 days ago
parent
commit
b1ae3be8d3

+ 9 - 0
src/api/dialysis.js View File

566
     method:"Get",
566
     method:"Get",
567
     params:params
567
     params:params
568
   })
568
   })
569
+}
570
+
571
+export function getPatientBefor(params){
572
+ 
573
+  return request({
574
+    url:"/api/schedule/getpatientbefor",
575
+    method:"Get",
576
+    params:params,
577
+  })
569
 }
578
 }

+ 44 - 2
src/xt_pages/dialysis/batch_print/batch_print_order_eighty.vue View File

40
               </div>
40
               </div>
41
             </div>
41
             </div>
42
             <div class="inline_block" style="flex: 1;">
42
             <div class="inline_block" style="flex: 1;">
43
-              年龄:
43
+              年龄1:
44
               <div class="under_line" style="width: 30px; text-align: center">
44
               <div class="under_line" style="width: 30px; text-align: center">
45
                 <!-- {{ record.patient.age }} -->
45
                 <!-- {{ record.patient.age }} -->
46
-                {{ getAge(record.patient) }}
46
+                <!-- {{ getAge(record.patient) }} -->
47
+                {{ calculateAge(record.patient.id_card_no,record.prescription.record_date) }}
47
               </div>
48
               </div>
48
49
49
             </div>
50
             </div>
1931
       });
1932
       });
1932
   },
1933
   },
1933
   methods: {
1934
   methods: {
1935
+    calculateAge(idNumber,created_time) {
1936
+    var year = this.getTimeOne(created_time)
1937
+
1938
+    var month = this.getTimeTwo(created_time)
1939
+
1940
+    var day = this.getTimeThree(created_time)
1941
+    console.log("start_time=====",year)
1942
+    // 假设身份证号码是18位,且生日在第7位到第14位
1943
+    const birthYear = parseInt(idNumber.substring(6, 10), 10);
1944
+    const birthMonth = parseInt(idNumber.substring(10, 12), 10);
1945
+    const birthDay = parseInt(idNumber.substring(12, 14), 10);
1946
+ 
1947
+    const today = new Date();
1948
+    // console.log("today============",today)
1949
+    var ageYear = year - birthYear;
1950
+    let ageMonth = month - birthMonth; // 月份是从0开始的
1951
+    let ageDay = day - birthDay;
1952
+ 
1953
+    // 调整月份和日期,以便于正确计算
1954
+      if (ageDay < 0) {
1955
+          ageMonth -= 1;
1956
+          // 获取上个月的天数
1957
+          const pastMonthDay = new Date(year,month, 0).getDate();
1958
+          ageDay += pastMonthDay;
1959
+      }
1960
+      if (ageMonth < 0) {
1961
+          ageYear -= 1;
1962
+          ageMonth += 12;
1963
+      }
1964
+   
1965
+     return ageYear 
1966
+    },
1967
+    getTimeOne(val) {
1968
+      return uParseTime(val, "{y}");
1969
+    },
1970
+    getTimeTwo(val) {
1971
+      return uParseTime(val, "{m}");
1972
+    },
1973
+    getTimeThree(val) {
1974
+      return uParseTime(val, "{h}");
1975
+    },
1934
     getmode(id){
1976
     getmode(id){
1935
       const options = this.modeOptions
1977
       const options = this.modeOptions
1936
       if(id !=0){
1978
       if(id !=0){

+ 2 - 1
src/xt_pages/dialysis/batch_print/batch_print_order_sixtyeight.vue View File

2980
                           />
2980
                           />
2981
                         </div>
2981
                         </div>
2982
                       </div>
2982
                       </div>
2983
-                      <div class="inline_block" style="flex: 1">
2983
+                      <div class="inline_block" style="flex: 1" >
2984
                         治疗医生:
2984
                         治疗医生:
2985
                         <div
2985
                         <div
2986
+                          v-if="org_id!=10677"
2986
                           class="under_line"
2987
                           class="under_line"
2987
                           style="width: 80px; text-align: center"
2988
                           style="width: 80px; text-align: center"
2988
                         >
2989
                         >

+ 1 - 1
src/xt_pages/dialysis/bloodPresssWatch.vue View File

1921
           this.$message.error(response.data.msg);
1921
           this.$message.error(response.data.msg);
1922
           return false;
1922
           return false;
1923
         } else {
1923
         } else {
1924
-          if(this.org_id ==10206){
1924
+          if(this.org_id ==10206 || this.org_id == 0){
1925
             this.template_id = 80
1925
             this.template_id = 80
1926
             // this.template_id = 81
1926
             // this.template_id = 81
1927
             console.log("templage-i233232323232322323233232323223",this.template_id)
1927
             console.log("templage-i233232323232322323233232323223",this.template_id)

+ 57 - 5
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue View File

1476
 </template>
1476
 </template>
1477
 
1477
 
1478
 <script>
1478
 <script>
1479
-  import { CreateGroupAdvice, GetSolution, postPrescription, postSoulution,saveInformation,getPatientRecordList } from '@/api/dialysis'
1479
+  import { CreateGroupAdvice, GetSolution, postPrescription, postSoulution,saveInformation,getPatientRecordList,getPatientBefor } from '@/api/dialysis'
1480
   import { getDataConfig } from '@/utils/data'
1480
   import { getDataConfig } from '@/utils/data'
1481
   import { calculateAnticoagulantZL, uParseTime,replacementFlow } from '@/utils/tools'
1481
   import { calculateAnticoagulantZL, uParseTime,replacementFlow } from '@/utils/tools'
1482
   import store from '@/store'
1482
   import store from '@/store'
2634
         }
2634
         }
2635
       },
2635
       },
2636
       show(pre, schedual, last, his_is_open,is_advice_open,admins) {
2636
       show(pre, schedual, last, his_is_open,is_advice_open,admins) {
2637
-
2637
+        console.log("除非=======================")
2638
+      
2638
         if(this.$store.getters.xt_user.template_info.org_id==10702 || this.$store.getters.xt_user.template_info.org_id==10635  || this.$store.getters.xt_user.template_info.org_id==0   || this.$store.getters.xt_user.template_info.org_id==10721){
2639
         if(this.$store.getters.xt_user.template_info.org_id==10702 || this.$store.getters.xt_user.template_info.org_id==10635  || this.$store.getters.xt_user.template_info.org_id==0   || this.$store.getters.xt_user.template_info.org_id==10721){
2639
           if(this.predialysis!=undefined){
2640
           if(this.predialysis!=undefined){
2640
             if(this.dialysisPrescription.target_ultrafiltration==0 || this.dialysisPrescription.target_ultrafiltration==""){
2641
             if(this.dialysisPrescription.target_ultrafiltration==0 || this.dialysisPrescription.target_ultrafiltration==""){
2641
-              this.dialysisPrescription.target_ultrafiltration = (this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(2)
2642
+              this.dialysisPrescription.target_ultrafiltration = (this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(1)
2642
             }
2643
             }
2643
 
2644
 
2644
             if(this.dialysisPrescription.prescription_water==0 || this.dialysisPrescription.prescription_water==""){
2645
             if(this.dialysisPrescription.prescription_water==0 || this.dialysisPrescription.prescription_water==""){
2645
-              if((this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(2)>0){
2646
-                this.dialysisPrescription.prescription_water = (this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(2)
2646
+              if((this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(1)>0){
2647
+                this.dialysisPrescription.prescription_water = (this.predialysis.weight_before - this.predialysis.dry_weight - this.predialysis.additional_weight).toFixed(1)
2647
               }
2648
               }
2648
 
2649
 
2649
             }
2650
             }
3100
         this.pre = pre
3101
         this.pre = pre
3101
         // console.log("pre1", pre);
3102
         // console.log("pre1", pre);
3102
         this.getPermission()
3103
         this.getPermission()
3104
+        if(this.$store.getters.xt_user.template_info.org_id==10164 || this.$store.getters.xt_user.template_info.org_id==10721 || this.$store.getters.xt_user.template_info.org_id==10635 || this.$store.getters.xt_user.template_info.org_id==0){
3105
+          this.getPatientBefor()
3106
+        }
3107
+      
3103
 
3108
 
3104
         let last_weight_after = 0
3109
         let last_weight_after = 0
3105
         let weight_before = 0
3110
         let weight_before = 0
4884
           }
4889
           }
4885
         })
4890
         })
4886
     },
4891
     },
4892
+    getPatientBefor(){
4893
+     
4894
+       var patient_id = 0
4895
+       var record_date =""
4896
+       if(this.$route.query.patient_id!=undefined){
4897
+        patient_id =this.$route.query.patient_id
4898
+        record_date = uParseTime(this.$route.query.date, '{y}-{m}-{d}')
4899
+       }else{
4900
+        patient_id = this.patient.id
4901
+        record_date = this.record_date
4902
+       }
4903
+       var params = {
4904
+        patient_id:patient_id,
4905
+        record_date:record_date
4906
+       }
4907
+       console.log("param----------------",params)
4908
+      getPatientBefor(params).then(response=>{
4909
+         if(response.data.state == 1){
4910
+          var patientBefor = response.data.data.patientBefor
4911
+          var prescription = response.data.data.prescription
4912
+          if(patientBefor!=undefined){
4913
+            if(this.dialysisPrescription.target_ultrafiltration==0 || this.dialysisPrescription.target_ultrafiltration==""){
4914
+              this.dialysisPrescription.target_ultrafiltration = (patientBefor.weight_before - patientBefor.dry_weight - patientBefor.additional_weight).toFixed(1)
4915
+            }
4916
+
4917
+            if(this.dialysisPrescription.prescription_water==0 || this.dialysisPrescription.prescription_water==""){
4918
+              if((patientBefor.weight_before - patientBefor.dry_weight - patientBefor.additional_weight).toFixed(1)>0){
4919
+                this.dialysisPrescription.prescription_water = (patientBefor.weight_before - patientBefor.dry_weight - patientBefor.additional_weight).toFixed(1)
4920
+              }
4921
+
4922
+            }
4923
+
4924
+            // if(this.$store.getters.xt_user.template_info.org_id==10721 || this.$store.getters.xt_user.template_info.org_id==10164 || this.$store.getters.xt_user.template_info.org_id==10635 || this.$store.getters.xt_user.template_info.org_id==0){
4925
+            //   this.dialysisPrescription.target_ultrafiltration = prescription.target_ultrafiltration
4926
+            //   this.dialysisPrescription.prescription_water = prescription.prescription_water
4927
+
4928
+            // }
4929
+          }
4930
+          if(prescription!=undefined){
4931
+           
4932
+            this.dialysisPrescription.target_ultrafiltration = prescription.target_ultrafiltration
4933
+            this.dialysisPrescription.prescription_water = prescription.prescription_water
4934
+          }
4935
+
4936
+         }
4937
+      }) 
4938
+    },
4887
     unique(arr) {
4939
     unique(arr) {
4888
       const res = new Map()
4940
       const res = new Map()
4889
       return arr.filter((arr) => !res.has(arr.name) && res.set(arr.name, 1))
4941
       return arr.filter((arr) => !res.has(arr.name) && res.set(arr.name, 1))

+ 1 - 1
src/xt_pages/dialysis/dialysisPrintOrder.vue View File

2686
           this.patient_id = response.data.data.patientInfo.DialysisSchedule.patient_id
2686
           this.patient_id = response.data.data.patientInfo.DialysisSchedule.patient_id
2687
           this.patient_name = response.data.data.patientInfo.name
2687
           this.patient_name = response.data.data.patientInfo.name
2688
 
2688
 
2689
-          if(this.org_id !=10206){
2689
+          if(this.org_id !=10206 && this.org_id !=0){
2690
             this.org_template_info.template_id= response.data.data.org_template_info.template_id
2690
             this.org_template_info.template_id= response.data.data.org_template_info.template_id
2691
             this.org_template_info = response.data.data.org_template_info;
2691
             this.org_template_info = response.data.data.org_template_info;
2692
           }else{
2692
           }else{

+ 1 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderSixtyeight.vue View File

2527
                         />
2527
                         />
2528
                       </div>
2528
                       </div>
2529
                       <div
2529
                       <div
2530
-                        v-if="org_id!=10191"
2530
+                        v-if="org_id!=10191 && org_id!=10677"
2531
                         class="under_line"
2531
                         class="under_line"
2532
                         style="width: 80px; text-align: center"
2532
                         style="width: 80px; text-align: center"
2533
                       >
2533
                       >

+ 81 - 3
src/xt_pages/dialysis/template/DialysisPrintOrdereighty.vue View File

35
           <div class="inline_block" style="flex: 1;">
35
           <div class="inline_block" style="flex: 1;">
36
             年龄:
36
             年龄:
37
             <div class="under_line" style="width: 30px; text-align: center">
37
             <div class="under_line" style="width: 30px; text-align: center">
38
-              {{ getAge(patientInfo) }}
38
+              <!-- {{ getAge(patientInfo) }} -->
39
+              {{ calculateAge(patientInfo.id_card_no,prescription.record_date) }}
39
             </div>
40
             </div>
40
41
41
           </div>
42
           </div>
1365
         <div class="inline_block" style="margin-left: 10px;">
1366
         <div class="inline_block" style="margin-left: 10px;">
1366
           年龄:
1367
           年龄:
1367
           <div class="under_line" style="width: 30px;text-align: left">
1368
           <div class="under_line" style="width: 30px;text-align: left">
1368
-            {{ getAge(patientInfo) }}
1369
+            <!-- {{ getAge(patientInfo) }} -->
1370
+            {{ calculateAge(patientInfo.id_card_no,prescription.record_date) }}
1369
           </div>
1371
           </div>
1370
1372
1371
         </div>
1373
         </div>
3432
       }else{
3434
       }else{
3433
         this.$message.success('核对完成')
3435
         this.$message.success('核对完成')
3434
       }
3436
       }
3435
-    }
3437
+    },
3438
+    calculateAge(idNumber,created_time) {
3439
+    var year = this.getTimeOne(created_time)
3440
+
3441
+    var month = this.getTimeTwo(created_time)
3442
+
3443
+    var day = this.getTimeThree(created_time)
3444
+    console.log("start_time=====",year)
3445
+    // 假设身份证号码是18位,且生日在第7位到第14位
3446
+    const birthYear = parseInt(idNumber.substring(6, 10), 10);
3447
+    const birthMonth = parseInt(idNumber.substring(10, 12), 10);
3448
+    const birthDay = parseInt(idNumber.substring(12, 14), 10);
3449
+ 
3450
+    const today = new Date();
3451
+    // console.log("today============",today)
3452
+    var ageYear = year - birthYear;
3453
+    let ageMonth = month - birthMonth; // 月份是从0开始的
3454
+    let ageDay = day - birthDay;
3455
+ 
3456
+    // 调整月份和日期,以便于正确计算
3457
+      if (ageDay < 0) {
3458
+          ageMonth -= 1;
3459
+          // 获取上个月的天数
3460
+          const pastMonthDay = new Date(year,month, 0).getDate();
3461
+          ageDay += pastMonthDay;
3462
+      }
3463
+      if (ageMonth < 0) {
3464
+          ageYear -= 1;
3465
+          ageMonth += 12;
3466
+      }
3467
+   
3468
+     return ageYear 
3469
+    },
3470
+    getTime(val) {
3471
+      return uParseTime(val, "{y}年{m}月{d}日");
3472
+    },
3473
+    getTimeOne(val) {
3474
+      return uParseTime(val, "{y}");
3475
+    },
3476
+    getTimeTwo(val) {
3477
+      return uParseTime(val, "{m}");
3478
+    },
3479
+    getTimeThree(val) {
3480
+      return uParseTime(val, "{h}");
3481
+    },
3482
+    calculateAge(idNumber,created_time) {
3483
+    var year = this.getTimeOne(created_time)
3484
+
3485
+    var month = this.getTimeTwo(created_time)
3486
+
3487
+    var day = this.getTimeThree(created_time)
3488
+    console.log("start_time=====",year)
3489
+    // 假设身份证号码是18位,且生日在第7位到第14位
3490
+    const birthYear = parseInt(idNumber.substring(6, 10), 10);
3491
+    const birthMonth = parseInt(idNumber.substring(10, 12), 10);
3492
+    const birthDay = parseInt(idNumber.substring(12, 14), 10);
3493
+ 
3494
+    const today = new Date();
3495
+    // console.log("today============",today)
3496
+    var ageYear = year - birthYear;
3497
+    let ageMonth = month - birthMonth; // 月份是从0开始的
3498
+    let ageDay = day - birthDay;
3499
+ 
3500
+    // 调整月份和日期,以便于正确计算
3501
+      if (ageDay < 0) {
3502
+          ageMonth -= 1;
3503
+          // 获取上个月的天数
3504
+          const pastMonthDay = new Date(year,month, 0).getDate();
3505
+          ageDay += pastMonthDay;
3506
+      }
3507
+      if (ageMonth < 0) {
3508
+          ageYear -= 1;
3509
+          ageMonth += 12;
3510
+      }
3511
+   
3512
+     return ageYear 
3513
+    },
3436
 
3514
 
3437
   },
3515
   },
3438
   watch: {
3516
   watch: {

+ 44 - 1
src/xt_pages/user/components/PatientDetail.vue View File

1332
                     年龄
1332
                     年龄
1333
                   </td>
1333
                   </td>
1334
                   <td style="padding: 5px 0px;font-size: 22px;width:10%;">
1334
                   <td style="padding: 5px 0px;font-size: 22px;width:10%;">
1335
-                    {{ patientPrint.age }}岁
1335
+                    <!-- {{ patientPrint.age }} -->
1336
+                     {{ calculateAge(patientPrint.id_card_no,patientPrint.created_time) }}
1337
+                    岁
1336
                   </td>
1338
                   </td>
1337
                   <td style="padding: 5px 0px;font-size: 22px;font-weight: 500;width:12%;">
1339
                   <td style="padding: 5px 0px;font-size: 22px;font-weight: 500;width:12%;">
1338
                     医保类型
1340
                     医保类型
1835
     this.printDate = data.getFullYear() + "-" + month + "-" + date;
1837
     this.printDate = data.getFullYear() + "-" + month + "-" + date;
1836
   },
1838
   },
1837
   methods: {
1839
   methods: {
1840
+   calculateAge(idNumber,created_time) {
1841
+    var year = this.getTimeOne(created_time)
1842
+
1843
+    var month = this.getTimeTwo(created_time)
1844
+
1845
+    var day = this.getTimeThree(created_time)
1846
+    console.log("start_time=====",year)
1847
+    // 假设身份证号码是18位,且生日在第7位到第14位
1848
+    const birthYear = parseInt(idNumber.substring(6, 10), 10);
1849
+    const birthMonth = parseInt(idNumber.substring(10, 12), 10);
1850
+    const birthDay = parseInt(idNumber.substring(12, 14), 10);
1851
+ 
1852
+    const today = new Date();
1853
+    // console.log("today============",today)
1854
+    var ageYear = year - birthYear;
1855
+    let ageMonth = month - birthMonth; // 月份是从0开始的
1856
+    let ageDay = day - birthDay;
1857
+ 
1858
+    // 调整月份和日期,以便于正确计算
1859
+      if (ageDay < 0) {
1860
+          ageMonth -= 1;
1861
+          // 获取上个月的天数
1862
+          const pastMonthDay = new Date(year,month, 0).getDate();
1863
+          ageDay += pastMonthDay;
1864
+      }
1865
+      if (ageMonth < 0) {
1866
+          ageYear -= 1;
1867
+          ageMonth += 12;
1868
+      }
1869
+   
1870
+     return ageYear 
1871
+    },
1838
     getTime(val) {
1872
     getTime(val) {
1839
       return uParseTime(val, "{y}年{m}月{d}日");
1873
       return uParseTime(val, "{y}年{m}月{d}日");
1840
     },
1874
     },
1875
+    getTimeOne(val) {
1876
+      return uParseTime(val, "{y}");
1877
+    },
1878
+    getTimeTwo(val) {
1879
+      return uParseTime(val, "{m}");
1880
+    },
1881
+    getTimeThree(val) {
1882
+      return uParseTime(val, "{h}");
1883
+    },
1841
     printThisInfo() {
1884
     printThisInfo() {
1842
       var ptime = Math.round(new Date().getTime() / 1000);
1885
       var ptime = Math.round(new Date().getTime() / 1000);
1843
       this.print_time = uParseTime(ptime, "{y}年{m}月{d}日");
1886
       this.print_time = uParseTime(ptime, "{y}年{m}月{d}日");

+ 13 - 13
src/xt_permission.js View File

12
 
12
 
13
 router.beforeEach((to, from, next) => {
13
 router.beforeEach((to, from, next) => {
14
   // 线上注释
14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //   store.dispatch('VerifyConfigList', []).then(() => {
17
-  //     next()
18
-  //   })
19
-  // }
20
-  // if (store.getters.permission_routers === undefined) {
21
-  //   store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //     next()
23
-  //   })
24
-  // } else {
25
-  //   next()
26
-  // }
27
-  // return
15
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+    store.dispatch('VerifyConfigList', []).then(() => {
17
+      next()
18
+    })
19
+  }
20
+  if (store.getters.permission_routers === undefined) {
21
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+      next()
23
+    })
24
+  } else {
25
+    next()
26
+  }
27
+  return
28
   // 线上注释
28
   // 线上注释
29
   NProgress.start()
29
   NProgress.start()
30
   // console.log(store.getters.current_role_urls.indexOf(to.path))
30
   // console.log(store.getters.current_role_urls.indexOf(to.path))