瀏覽代碼

透析器/灌流器的更改

XMLWAN 4 年之前
父節點
當前提交
c68b73802d
共有 3 個文件被更改,包括 94 次插入120 次删除
  1. 28 23
      src/xt_pages/management/components/UserForm.vue
  2. 39 94
      src/xt_pages/management/home.vue
  3. 27 3
      src/xt_pages/management/index.vue

+ 28 - 23
src/xt_pages/management/components/UserForm.vue 查看文件

@@ -139,7 +139,7 @@
139 139
             min-width="110px"
140 140
           >
141 141
             <template slot-scope="scope">
142
-              {{ getTimes(scope.row.disinfec_startime) }}
142
+              {{ getTimesTwo(scope.row.disinfec_startime) }}
143 143
             </template>
144 144
           </el-table-column>
145 145
           <el-table-column
@@ -148,7 +148,7 @@
148 148
             min-width="110px"
149 149
           >
150 150
             <template slot-scope="scope">{{
151
-              getTimes(scope.row.disinfec_endtime)
151
+              getTimesTwo(scope.row.disinfec_endtime)
152 152
             }}</template>
153 153
           </el-table-column>
154 154
           <el-table-column
@@ -1451,6 +1451,16 @@ export default {
1451 1451
       } else {
1452 1452
         return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
1453 1453
       }
1454
+    },
1455
+     getTimesTwo(time) {
1456
+      if (time < 0) {
1457
+        return "";
1458
+      }
1459
+      if (time === 0) {
1460
+        return "";
1461
+      } else {
1462
+        return uParseTime(time, "{y}-{m}-{d} {h}:{i}");
1463
+      }
1454 1464
     },
1455 1465
     // 获取签名
1456 1466
     getAllOrganization() {
@@ -1466,15 +1476,18 @@ export default {
1466 1476
       EditUser(id, patientid).then(response => {
1467 1477
         if (response.data.state === 1) {
1468 1478
           var device = response.data.data.device;
1469
-          //console.log("device", device);
1470 1479
           var patients = response.data.data.patients;
1471
-          // console.log('patients', patients)
1472
-          // eslint-disable-next-line no-sequences
1473
-          (this.userform.id = device.id),
1474
-            (this.userform.spling_date = uParseTime(
1480
+          var count =  response.data.data.count
1481
+          var macher =  response.data.data.macher
1482
+           if(macher.user_total == ''){
1483
+             macher.user_total = 0
1484
+           }   
1485
+          var totals = count[0].Total + parseInt(macher.user_total)
1486
+          this.userform.id = device.id;
1487
+          this.userform.spling_date = uParseTime(
1475 1488
               device.date,
1476 1489
               "{y}-{m}-{d}"
1477
-            ));
1490
+           );
1478 1491
           this.userform.patient_id = device.patient_id;
1479 1492
           this.userform.classtype = device.class;
1480 1493
           this.userform.zone = device.zone;
@@ -1490,7 +1503,7 @@ export default {
1490 1503
           this.userform.hyperfiltratio = device.hyperfiltratio;
1491 1504
           this.userform.weight_loss = device.weight_loss;
1492 1505
           this.userform.warning_value = device.warning_value;
1493
-          this.userform.user_total = device.user_total;
1506
+       
1494 1507
           this.userform.run = device.move;
1495 1508
 
1496 1509
           this.userform.failure_stage = device.failure_stage;
@@ -1506,6 +1519,7 @@ export default {
1506 1519
           this.userform.disinfection_residue = device.disinfection_residue;
1507 1520
           this.userform.longtime = device.long_time;
1508 1521
           this.userform.dialysis_time = device.dialysis_hour;
1522
+          // this.userform.user_total = device.user_total
1509 1523
           // this.userform.starttime = uParseTime(
1510 1524
           //   device.disinfec_startime,
1511 1525
           //  '{y}-{m}-{d} {h}:{i}'
@@ -1554,6 +1568,7 @@ export default {
1554 1568
           if (device.disinfection === 0) {
1555 1569
             this.userform.disinfection = "";
1556 1570
           }
1571
+          this.userform.user_total = totals.toString() 
1557 1572
         }
1558 1573
       });
1559 1574
     },
@@ -1978,13 +1993,10 @@ export default {
1978 1993
     getUserForm(id) {
1979 1994
       getUserForm(id, this.limit, this.page).then(response => {
1980 1995
         if (response.data.state === 1) {
1981
-          var information = response.data.data.information;
1982
-          //console.log("数据是-------", information);
1983
-          // eslint-disable-next-line no-unused-vars
1996
+          var information = response.data.data.information; 
1997
+          console.log("information",information)
1984 1998
           var addmacher = response.data.data.addmacher;
1985
-          // console.log('addmacher', addmacher)
1986
-          // this.bed = addmacher.bed_number
1987
-
1999
+          console.log("addmacher",addmacher)
1988 2000
           for (let index = 0; index < information.length; index++) {
1989 2001
             if (information[index].class === 1) {
1990 2002
               information[index].class = "上午";
@@ -2086,7 +2098,7 @@ export default {
2086 2098
               information[index].disinfectant_type = "500mg/l含氯消毒剂";
2087 2099
             }
2088 2100
             if (information[index].disinfectant_type === 3) {
2089
-              information[idnex].disinfectant_type = "1000mg/l含氯消毒剂";
2101
+              information[index].disinfectant_type = "1000mg/l含氯消毒剂";
2090 2102
             }
2091 2103
             if (information[index].disinfectant_type === 4) {
2092 2104
               information[index].disinfectant_type = "1500mg/l含氯消毒剂";
@@ -2217,9 +2229,6 @@ export default {
2217 2229
             if (information[index].clean === 2) {
2218 2230
               information[index].clean = "";
2219 2231
             }
2220
-
2221
-            // this.form.zone = information[index].zone
2222
-            // this.form.bed = information[index].bed_number
2223 2232
           }
2224 2233
           var total = response.data.data.total;
2225 2234
           console.log("total", total);
@@ -2232,7 +2241,6 @@ export default {
2232 2241
       getBedForm(id).then(response => {
2233 2242
         if (response.data.state === 1) {
2234 2243
           var addmacher = response.data.data.addmacher;
2235
-          console.log("addmacher=============", addmacher);
2236 2244
           var number = response.data.data.number;
2237 2245
           console.log("number", number);
2238 2246
           //改动
@@ -2258,8 +2266,6 @@ export default {
2258 2266
       PostSearch(key).then(response => {
2259 2267
         if (response.data.state == 1) {
2260 2268
           searchArray = response.data.data.patient;
2261
-          // console.log("ser=================",searchArray)
2262
-
2263 2269
           cb(searchArray);
2264 2270
         }
2265 2271
       });
@@ -2350,7 +2356,6 @@ export default {
2350 2356
   },
2351 2357
   watch: {
2352 2358
     userdata(newvalue, oldvalue) {
2353
-      console.log("newvalue是什么", newvalue);
2354 2359
       this.getUserForm(newvalue);
2355 2360
       this.getBedForm(newvalue);
2356 2361
       this.value = newvalue;

+ 39 - 94
src/xt_pages/management/home.vue 查看文件

@@ -2075,7 +2075,7 @@
2075 2075
   import { getAllSubregion, getAllMachine, getMachineDetailById,
2076 2076
     UpdateMachineInfo, getAllPlan, getAllPlanDetail, DeletePlans,
2077 2077
     getAllEquimentName, EditPlanDetail, UpdatePlanInfo, SaveInformation, getPatientInfo,
2078
-    ChangeClass, getAllOrganization, getUserRegister, SaveQualityControl, getOrgName, SaveRepair, SaveBacteria, SaveLincomycin, getAutoData, getAllEquitType, UpdateMacheineTwo, getTotalNumber, getTimeWarning, getTimeBeteen, getAllpatient, UpdateMachineInfoTwo, getPatientDetail, openDelete, getAllMode, selectChange, selectBed } from '@/api/manage'
2078
+    ChangeClass, getAllOrganization, getUserRegister, SaveQualityControl, getOrgName, SaveRepair, SaveBacteria, SaveLincomycin, getAutoData, getAllEquitType, UpdateMacheineTwo, getTotalNumber, getTimeWarning, getTimeBeteen, getAllpatient, UpdateMachineInfoTwo, getPatientDetail, openDelete, getAllMode, selectChange, selectBed,GetUserTotalCount } from '@/api/manage'
2079 2079
   import { uParseTime } from '@/utils/tools'
2080 2080
   import { getToken } from '@/api/qiniu'
2081 2081
   import PlanForm from './components/PlanForm'
@@ -2621,7 +2621,6 @@ export default {
2621 2621
             zone.push({ id: item.id, name: item.name })
2622 2622
           }
2623 2623
           var devicenumber = response.data.data.devicenumber
2624
-          // console.log('devicenumber', devicenumber)
2625 2624
           this.bedZone = zone
2626 2625
 
2627 2626
           var zoness = [{ id: 0, name: '请选择' }]
@@ -2633,7 +2632,6 @@ export default {
2633 2632
           var bed = [{ id: 0, number: '请选择' }]
2634 2633
           for (let i = 0; i < numbers.length; i++) {
2635 2634
             const item = numbers[i]
2636
-            // console.log(item)
2637 2635
             bed.push({ id: item.id, number: item.number })
2638 2636
           }
2639 2637
           this.bedNumberTwo = bed
@@ -2641,7 +2639,6 @@ export default {
2641 2639
           this.bedZoneThree = zoness
2642 2640
           this.bedNumber = numbers
2643 2641
 
2644
-          // this.Number = devicenumber
2645 2642
         })
2646 2643
       },
2647 2644
 
@@ -2666,7 +2663,6 @@ export default {
2666 2663
         getAllMachine(this.forms.zone_id, this.forms.device_type).then(response => {
2667 2664
           if (response.data.state === 1) {
2668 2665
             var addmahcer = response.data.data.addmahcer
2669
-            console.log('查找的数据', addmahcer)
2670 2666
             for(let j=0;j<addmahcer.length;j++){
2671 2667
               if(addmahcer[j].device_type == 1){
2672 2668
                  addmahcer[j].bed_number = addmahcer[j].number
@@ -2688,7 +2684,7 @@ export default {
2688 2684
               }
2689 2685
 
2690 2686
             }
2691
-            // this.$refs.singleTable.setCurrentRow(this.tableDatatwo[this.tabIndex])
2687
+            
2692 2688
           }
2693 2689
         })
2694 2690
       },
@@ -2697,7 +2693,6 @@ export default {
2697 2693
       },
2698 2694
       handleCurrentChange(val) {
2699 2695
         this.unitType = val.unit_type
2700
-        // console.log('val是什么', val)
2701 2696
         this.currentRow = val
2702 2697
         this.$forceUpdate()
2703 2698
         this.getMachineDetailById(val.id)
@@ -2709,8 +2704,7 @@ export default {
2709 2704
         this.getUserRegister(val.id)
2710 2705
         // 病人下机后插入数据
2711 2706
         this.getAutoData(val.id)
2712
-        this.getTotalNumber(val.id)
2713
-        // this.getTimeWarning(val.id)
2707
+        this.GetUserTotalCount(val.bed_id)
2714 2708
         this.getTimeBeteen(val.id)
2715 2709
         this.getData(val.bed_id)
2716 2710
       },
@@ -2725,35 +2719,17 @@ export default {
2725 2719
         getMachineDetailById(id).then(response => {
2726 2720
           if (response.data.state === 1) {
2727 2721
             var addmacher = response.data.data.addmacher
2728
-            console.log('设备详情', addmacher)
2729 2722
             var warning = response.data.data.warning
2730
-            // console.log('warning', warning)
2723
+          
2731 2724
             var time = this.getTimestamp(this.userform.date) - warning.stime
2732
-            // console.log('时间', time)
2733
-            // if (time < 2678400 && warning.dialysis_checked === 1) {
2734
-            //   this.warnShow = false
2735
-            // } else {
2736
-            //   this.warnShow = true
2737
-            // }
2738 2725
             var germ = response.data.data.germ
2739
-            // console.log('germ', germ)
2726
+          
2740 2727
             var timetwo = this.getTimestamp(this.userform.date) - germ.stime
2741
-            // console.log('时间', timetwo)
2742
-            // if (timetwo < 2678400 && germ.germ_checked === 1) {
2743
-            //   this.warnShowTwo = false
2744
-            // } else {
2745
-            //   this.warnShowTwo = true
2746
-            // }
2728
+           
2747 2729
             var clean = response.data.data.clean
2748 2730
             var timethree = this.getTimestamp(this.userform.date) - clean.stime
2749
-            // console.log('时间', timethree)
2750
-            // if (timethree < 2678400 && clean.clean === 1) {
2751
-            //   this.warnShowThree = false
2752
-            // } else {
2753
-            //   this.warnShowThree = true
2754
-            // }
2755 2731
             var number = response.data.data.number
2756
-            // console.log('number', number)
2732
+          
2757 2733
             this.Number = number
2758 2734
             if (addmacher.device_type === 1) {
2759 2735
               this.sShow = false
@@ -2794,7 +2770,7 @@ export default {
2794 2770
             var zone = response.data.data.zone
2795 2771
 
2796 2772
             const arr1 = []
2797
-            //  const cityOptions = ['HD', 'HDF', 'HD+HP', 'HP', 'HF', 'SCUF', 'IUF', 'HFHD+HP', 'HFR', 'HDF+HP', 'GRRT', '腹水回收']
2773
+          
2798 2774
             for (let index = 0; index < mode.length; index++) {
2799 2775
               if (mode[index].treate_mode === 1) {
2800 2776
                 mode[index] = 'HD'
@@ -2883,7 +2859,7 @@ export default {
2883 2859
             this.form.machine_status = addmacher.machine_status
2884 2860
             this.form.user_total = addmacher.user_total
2885 2861
             this.form.remarks = addmacher.remarks
2886
-            // this.form.device_mode = addmacher.device_mode
2862
+           
2887 2863
             if (addmacher.rubbish_date !== 0) {
2888 2864
               this.form.rubbish_date = uParseTime(addmacher.rubbish_date, '{y}-{m}-{d}')
2889 2865
             }
@@ -2990,19 +2966,16 @@ export default {
2990 2966
         var bed_numberss = parseInt(bed_numbers)
2991 2967
         this.form.bed_number = bed_numberss
2992 2968
         this.$refs[formName].validate(valid => {
2993
-          UpdateMachineInfo(this.form).then(response => {
2994
-            // console.log('form', this.form)
2969
+          UpdateMachineInfo(this.form).then(response => {         
2995 2970
             if (response.data.state === 1) {
2996
-              var addmacher = response.data.data.addmacher
2997
-              // console.log('addmacher----', addmacher)
2998
-              this.$message.success('修改成功')
2999
-              // this.$router.push({ path: '/device/home?index=' + this.tabIndex })
2971
+              var addmacher = response.data.data.addmacher         
2972
+              this.$message.success('修改成功')           
3000 2973
               for (let i = 0; i < this.tableDatatwo.length; i++) {
3001 2974
                 if (this.tableDatatwo[i].id == addmacher.id) {
3002 2975
                   for (let j = 0; j < this.deviceMode.length; j++) {
3003 2976
                     if (this.deviceMode[j].id === parseInt(addmacher.unit_type)) {
3004 2977
                       addmacher.device_mode = this.deviceMode[j].device_mode
3005
-                      //   this.$forceUpdate()
2978
+                    
3006 2979
                     }
3007 2980
                   }
3008 2981
 
@@ -3174,7 +3147,7 @@ export default {
3174 3147
         getAllPlan().then(response => {
3175 3148
           if (response.data.state === 1) {
3176 3149
             var plan = response.data.data.plan
3177
-
3150
+            console.log("plan=====",plan )
3178 3151
             for (let index = 0; index < plan.length; index++) {
3179 3152
               if (plan[index].time === 1) {
3180 3153
                 plan[index].time = '周一'
@@ -3233,7 +3206,7 @@ export default {
3233 3206
               if (plan[index].machine_disinfectant === 2) {
3234 3207
                 plan[index].machine_disinfectant = '500mg/l含氯消毒剂'
3235 3208
               }
3236
-              if (plan[index].machine_disinfectantant === 3) {
3209
+              if (plan[index].machine_disinfectant === 3) {
3237 3210
                 plan[index].machine_disinfectant = '1000mg/l含氯消毒剂'
3238 3211
               }
3239 3212
               if (plan[index].machine_disinfectant === 4) {
@@ -3308,7 +3281,7 @@ export default {
3308 3281
         getAllPlanDetail(unit_type).then(response => {
3309 3282
           if (response.data.state === 1) {
3310 3283
             var plandetail = response.data.data.plandetail
3311
-            // console.log('plandetail', plandetail)
3284
+            console.log("plandetail",plandetail)
3312 3285
             for (let index = 0; index < plandetail.length; index++) {
3313 3286
               if (plandetail[index].time === 1) {
3314 3287
                 plandetail[index].time = '周一'
@@ -3367,7 +3340,7 @@ export default {
3367 3340
               if (plandetail[index].machine_disinfectant === 2) {
3368 3341
                 plandetail[index].machine_disinfectant = '500mg/l含氯消毒剂'
3369 3342
               }
3370
-              if (plandetail[index].machine_disinfectantant === 3) {
3343
+              if (plandetail[index].machine_disinfectant === 3) {
3371 3344
                 plandetail[index].machine_disinfectant = '1000mg/l含氯消毒剂'
3372 3345
               }
3373 3346
               if (plandetail[index].machine_disinfectant === 4) {
@@ -3665,15 +3638,11 @@ export default {
3665 3638
             }
3666 3639
             this.userform.date = uParseTime(patients.schedule_date, '{y}-{m}-{d}')
3667 3640
             this.userform.patient_name = patients.name
3668
-            this.userform.patient_id = patients.patient_id
3669
-            // this.userform.patient_name = patients.name
3641
+            this.userform.patient_id = patients.patient_id 
3670 3642
             var zone = response.data.data.zone
3671
-            // console.log('zone==========', zone)
3672 3643
             this.userform.zone = zone.id
3673 3644
             var number = response.data.data.number
3674
-            // console.log('nubmer', number)
3675 3645
             this.userform.bed_number = number.id
3676
-            // this.userform.bed_number = number.number
3677 3646
             var order = response.data.data.order
3678 3647
             this.userform.start_time = uParseTime(order.start_time, '{y}-{m}-{d} {h}:{i}')
3679 3648
             this.userform.end_time = uParseTime(order.end_time, '{y}-{m}-{d} {h}:{i}')
@@ -3811,8 +3780,7 @@ export default {
3811 3780
         if (this.userform.user_total === '0') {
3812 3781
           this.userform.user_total = 0
3813 3782
         }
3814
-        // console.log('上机时间', this.userform.start_time)
3815
-        // console.log('下机时间', this.userform.end_time)
3783
+       
3816 3784
         this.$refs[formName].validate((valid) => {
3817 3785
           if (valid) {
3818 3786
             SaveInformation(this.equimentid, this.userform).then(response => {
@@ -3867,7 +3835,6 @@ export default {
3867 3835
         getAllOrganization().then(response => {
3868 3836
           if (response.data.state === 1) {
3869 3837
             var approle = response.data.data.approle
3870
-            // console.log('approle签名',approle)
3871 3838
             this.autograph = approle
3872 3839
             this.sampling = approle
3873 3840
           }
@@ -3877,11 +3844,7 @@ export default {
3877 3844
         getUserRegister(id).then(response => {
3878 3845
           if (response.data.state === 1) {
3879 3846
             var information = response.data.data.information
3880
-             console.log('产讯使用登记', information)
3881
-            // eslint-disable-next-line no-unused-vars
3882 3847
             var role = response.data.data.role
3883
-            // console.log('role', role)
3884
-            // eslint-disable-next-line eqeqeq
3885 3848
             var dislysis = response.data.data.dislysis
3886 3849
 
3887 3850
             this.userform.id = information.id
@@ -3899,12 +3862,8 @@ export default {
3899 3862
             this.userform.contagion = information.contagion
3900 3863
             this.userform.dialysis_mode = information.dialysis_mode
3901 3864
             this.userform.start_time = this.updateTimes(information.start_time)
3902
-            // this.userform.start_time = uParseTime(information.start_time, '{y}-{m}-{d} {h}:{i}')
3903 3865
             this.userform.end_time = this.updateTimes(information.end_time)
3904 3866
             // this.userform.end_time = uParseTime(information.end_time, '{y}-{m}-{d} {h}:{i}')
3905
-            // this.userform.dialysis_time = information.dialysis_hour
3906
-            // this.userform.hyperfiltratio = information.hyperfiltratio
3907
-            // this.userform.weight_loss = information.weight_loss
3908 3867
             if (information.hyperfiltratio === '') {
3909 3868
               this.userform.hyperfiltratio = dislysis.actual_ultrafiltration
3910 3869
             } else {
@@ -3915,15 +3874,12 @@ export default {
3915 3874
             } else {
3916 3875
               this.userform.dialysis_time = information.dialysis_hour
3917 3876
             }
3918
-            // this.userform.dialysis_time = dislysis.actual_treatment_hour + 'h' + dislysis.actual_treatment_minute + 'min'
3919
-            // this.userform.hyperfiltratio = dislysis.actual_ultrafiltration
3920 3877
             if (information.weight_loss === '') {
3921 3878
               this.userform.weight_loss = dislysis.weight_loss
3922 3879
             } else {
3923 3880
               this.userform.weight_loss = information.weight_loss
3924 3881
             }
3925 3882
 
3926
-            // this.userform.weight_loss = dislysis.weight_loss
3927 3883
             this.userform.warning_value = information.warning_value
3928 3884
             this.userform.user_total = information.user_total
3929 3885
             if (information.move === 0) {
@@ -3944,8 +3900,6 @@ export default {
3944 3900
             this.userform.longtime = information.long_time
3945 3901
             this.userform.starttime = this.updateTimes(information.disinfec_startime)
3946 3902
             this.userform.endtime = this.updateTimes(information.disinfec_endtime)
3947
-            // this.userform.starttime = uParseTime(information.disinfec_startime, '{y}-{m}-{d} {h}:{i}')
3948
-            // this.userform.endtime = uParseTime(information.disinfec_endtime, '{y}-{m}-{d} {h}:{i}')
3949 3903
 
3950 3904
             if (information.dialysis_checked === 1) {
3951 3905
               this.userform.dialysis_checked = true
@@ -4097,7 +4051,6 @@ export default {
4097 4051
             SaveQualityControl(this.equimentid, this.qualityFormThree).then(response => {
4098 4052
               if (response.data.state === 1) {
4099 4053
                 var ion = response.data.data.ion
4100
-                // console.log('ion', ion)
4101 4054
                 this.$message.success('保存成功')
4102 4055
                 this.$refs.child.getAllQulityInfo()
4103 4056
                 this.qualityFormThree.samplerc = ''
@@ -4187,11 +4140,9 @@ export default {
4187 4140
         return new Promise((resolve, reject) => {
4188 4141
           getToken().then(response => {
4189 4142
             const token = response.data.data.uptoken
4190
-            console.log('token', token)
4191 4143
             _self._data.uploadFileData.token = token
4192 4144
             _self._data.uploadFileData.key = key
4193 4145
             resolve(true)
4194
-          // eslint-disable-next-line handle-callback-err
4195 4146
           }).catch(err => {
4196 4147
             reject(false)
4197 4148
           })
@@ -4199,7 +4150,6 @@ export default {
4199 4150
       },
4200 4151
       handleSuccess(res, file, fileList) {
4201 4152
         this.guaForm.images = this.qiniuDomain + res.url
4202
-        console.log('图片路径', this.guaForm.images)
4203 4153
         this.$refs.upload.clearFiles()
4204 4154
         this.filename = file.name
4205 4155
         this.guaForm.imageName = file.name
@@ -4244,7 +4194,6 @@ export default {
4244 4194
             SaveRepair(this.equimentid, this.guaForm).then(response => {
4245 4195
               if (response.data.state === 1) {
4246 4196
                 var repair = response.data.data.repair
4247
-                // console.log('reqair', repair)
4248 4197
                 this.$message.success('保存成功')
4249 4198
                 this.$refs.child.getAllRepair()
4250 4199
                 this.guaForm.start_time = ''
@@ -4276,8 +4225,6 @@ export default {
4276 4225
         PostSearch(key).then(response => {
4277 4226
           if (response.data.state == 1) {
4278 4227
             searchArray = response.data.data.patient
4279
-            // console.log("ser",searchArray)
4280
-
4281 4228
             cb(searchArray)
4282 4229
           }
4283 4230
         })
@@ -4297,7 +4244,6 @@ export default {
4297 4244
           // eslint-disable-next-line eqeqeq
4298 4245
           if (response.data.state == 1) {
4299 4246
             var patient = response.data.data.patient
4300
-            // console.log('patient', patient)
4301 4247
             // eslint-disable-next-line no-undef
4302 4248
             if (patient.is_infectious === 0) {
4303 4249
               this.userform.contagion = ''
@@ -4348,28 +4294,15 @@ export default {
4348 4294
           if (response.data.state === 1) {
4349 4295
             var information = response.data.data.information
4350 4296
             var time = this.getTimestamp(this.userform.date) - information.stime
4351
-            // console.log('时间', time)
4352
-            // if (time < 2678400) {
4353
-            //   this.warnShow = false
4354
-            // }
4355 4297
             var deviceInformation = response.data.data.deviceInformation
4356
-
4357 4298
             var timetwo = this.getTimestamp(this.userform.date) - deviceInformation.stime
4358
-            // if (timetwo < 2678400) {
4359
-            //  this.warnShowTwo = false
4360
-            // }
4361
-
4362 4299
             var clean = response.data.data.clean
4363
-            // var timethree = this.getTimestamp(this.userform.date) - clean.stime
4364
-            // if (timethree < 2678400) {
4365
-            //  this.warnShowThree = false
4366
-            // }
4300
+          
4367 4301
           }
4368 4302
         })
4369 4303
       },
4370 4304
       getTimeBeteen(id) {
4371 4305
         var todayTime = moment(new Date()).format('YYYY-MM-DD')
4372
-        // console.log('todayTime', todayTime)
4373 4306
         getTimeBeteen(id, todayTime).then(response => {
4374 4307
           if (response.data.state === 1) {
4375 4308
             var timedata = response.data.data.timeData
@@ -4380,7 +4313,6 @@ export default {
4380 4313
               this.warnShow = false
4381 4314
             }
4382 4315
             var todayTimeTwo = response.data.data.timeDataTwo
4383
-            // console.log('todayTimeTwo', todayTimeTwo)
4384 4316
             if (todayTimeTwo.length === 0) {
4385 4317
               this.warnShowTwo = true
4386 4318
             }
@@ -4389,7 +4321,6 @@ export default {
4389 4321
             }
4390 4322
 
4391 4323
             var timeDataThree = response.data.data.timeDataThree
4392
-            //console.log('timeDataThree', timeDataThree)
4393 4324
             if (timeDataThree.length === 0) {
4394 4325
               this.warnShowThree = true
4395 4326
             }
@@ -4441,7 +4372,6 @@ export default {
4441 4372
             this.$forceUpdate()
4442 4373
             this.userform.bed_number = zone.id
4443 4374
             this.userform.zone = zone.zone_id
4444
-            // console.log('zone', zone)
4445 4375
           }
4446 4376
         })
4447 4377
       },
@@ -4461,15 +4391,27 @@ export default {
4461 4391
           this.guaForm.images = ''
4462 4392
           this.classShow = false
4463 4393
         })
4464
-      }
4394
+      },
4395
+
4396
+      //获取机器的使用次数
4397
+       GetUserTotalCount(bedid){
4398
+          this.userform.user_total = ""
4399
+         GetUserTotalCount(bedid).then(response=>{
4400
+            if(response.data.state == 1){
4401
+              var count =  response.data.data.count
4402
+              var addmacher = response.data.data.addmacher 
4403
+              if(addmacher.user_total == ''){
4404
+                  addmacher.user_total = 0
4405
+              }   
4406
+              this.userform.user_total = count[0].Total + parseInt(addmacher.user_total)
4407
+            }
4408
+         })
4409
+       }
4465 4410
     },
4466 4411
     created() {
4467 4412
       this.getAllSubregion()
4468 4413
       this.getAllMachine()
4469
-      var index = this.$route.query.index
4470 4414
       var bedid = this.$route.query.bedid
4471
-      // var id = this.$route.query.id
4472
-      // this.equimentid = id
4473 4415
       this.bedid = bedid
4474 4416
       this.getAllPlan()
4475 4417
       this.getAllEquimentName()
@@ -4478,6 +4420,9 @@ export default {
4478 4420
       this.getAllEquitType()
4479 4421
       this.getAllpatient()
4480 4422
       this.getAllMode()
4423
+      this.GetUserTotalCount(bedid)
4424
+      
4425
+
4481 4426
   }
4482 4427
   }
4483 4428
 </script>

+ 27 - 3
src/xt_pages/management/index.vue 查看文件

@@ -126,7 +126,7 @@
126 126
         </el-table-column>
127 127
 
128 128
         <el-table-column label="使用次数" align="center">
129
-          <template slot-scope="scope">{{ scope.row.user_total }}</template>
129
+          <template slot-scope="scope">{{getTotal(scope.row.bed_id,scope.row.user_total) }}</template>
130 130
         </el-table-column>
131 131
 
132 132
         <el-table-column label="操作" width="120" align="center">
@@ -162,7 +162,7 @@
162 162
 
163 163
 <script>
164 164
 import BreadCrumb from "../components/bread-crumb";
165
-import { getAllMachineInfo, getAllSubregion } from "@/api/manage";
165
+import { getAllMachineInfo, getAllSubregion,getUserMachTotalCount } from "@/api/manage";
166 166
 import ManageForm from "./components/ManageForm";
167 167
 
168 168
 export default {
@@ -205,7 +205,8 @@ export default {
205 205
         equipmentid: "",
206 206
         statusid: ""
207 207
       },
208
-      total: 0
208
+      total: 0,
209
+      count:[],
209 210
     };
210 211
   },
211 212
   methods: {
@@ -313,12 +314,35 @@ export default {
313 314
           id
314 315
       });
315 316
       // this.$router.push({ path: '/device/home?index=' + index + '&' + 'id=' + id })
317
+    },
318
+    getUserMachTotalCount(){
319
+        getUserMachTotalCount().then(response=>{
320
+           if(response.data.state == 1){
321
+             var count = response.data.data.count
322
+             console.log("count",count)
323
+             this.count = count
324
+           }
325
+        })
326
+    },
327
+    getTotal(id,usertotal){
328
+       if(usertotal == ''){
329
+           usertotal = 0
330
+       }
331
+       var count = 0
332
+       for(let i=0;i<this.count.length;i++){
333
+          if(id == this.count[i].bed_number){  
334
+            count = parseInt(this.count[i].Total)+parseInt(usertotal)        
335
+          }
336
+       }
337
+      //  console.log("count",count)
338
+       return count
316 339
     }
317 340
   },
318 341
   created() {
319 342
     // 获取所有的分区
320 343
     this.getAllSubregion();
321 344
     this.getAllMachineInfo();
345
+    this.getUserMachTotalCount()
322 346
   }
323 347
 };
324 348
 </script>