Browse Source

透析器/灌流器的更改

XMLWAN 4 years ago
parent
commit
c68b73802d

+ 28 - 23
src/xt_pages/management/components/UserForm.vue View File

139
             min-width="110px"
139
             min-width="110px"
140
           >
140
           >
141
             <template slot-scope="scope">
141
             <template slot-scope="scope">
142
-              {{ getTimes(scope.row.disinfec_startime) }}
142
+              {{ getTimesTwo(scope.row.disinfec_startime) }}
143
             </template>
143
             </template>
144
           </el-table-column>
144
           </el-table-column>
145
           <el-table-column
145
           <el-table-column
148
             min-width="110px"
148
             min-width="110px"
149
           >
149
           >
150
             <template slot-scope="scope">{{
150
             <template slot-scope="scope">{{
151
-              getTimes(scope.row.disinfec_endtime)
151
+              getTimesTwo(scope.row.disinfec_endtime)
152
             }}</template>
152
             }}</template>
153
           </el-table-column>
153
           </el-table-column>
154
           <el-table-column
154
           <el-table-column
1451
       } else {
1451
       } else {
1452
         return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
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
     getAllOrganization() {
1466
     getAllOrganization() {
1466
       EditUser(id, patientid).then(response => {
1476
       EditUser(id, patientid).then(response => {
1467
         if (response.data.state === 1) {
1477
         if (response.data.state === 1) {
1468
           var device = response.data.data.device;
1478
           var device = response.data.data.device;
1469
-          //console.log("device", device);
1470
           var patients = response.data.data.patients;
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
               device.date,
1488
               device.date,
1476
               "{y}-{m}-{d}"
1489
               "{y}-{m}-{d}"
1477
-            ));
1490
+           );
1478
           this.userform.patient_id = device.patient_id;
1491
           this.userform.patient_id = device.patient_id;
1479
           this.userform.classtype = device.class;
1492
           this.userform.classtype = device.class;
1480
           this.userform.zone = device.zone;
1493
           this.userform.zone = device.zone;
1490
           this.userform.hyperfiltratio = device.hyperfiltratio;
1503
           this.userform.hyperfiltratio = device.hyperfiltratio;
1491
           this.userform.weight_loss = device.weight_loss;
1504
           this.userform.weight_loss = device.weight_loss;
1492
           this.userform.warning_value = device.warning_value;
1505
           this.userform.warning_value = device.warning_value;
1493
-          this.userform.user_total = device.user_total;
1506
+       
1494
           this.userform.run = device.move;
1507
           this.userform.run = device.move;
1495
 
1508
 
1496
           this.userform.failure_stage = device.failure_stage;
1509
           this.userform.failure_stage = device.failure_stage;
1506
           this.userform.disinfection_residue = device.disinfection_residue;
1519
           this.userform.disinfection_residue = device.disinfection_residue;
1507
           this.userform.longtime = device.long_time;
1520
           this.userform.longtime = device.long_time;
1508
           this.userform.dialysis_time = device.dialysis_hour;
1521
           this.userform.dialysis_time = device.dialysis_hour;
1522
+          // this.userform.user_total = device.user_total
1509
           // this.userform.starttime = uParseTime(
1523
           // this.userform.starttime = uParseTime(
1510
           //   device.disinfec_startime,
1524
           //   device.disinfec_startime,
1511
           //  '{y}-{m}-{d} {h}:{i}'
1525
           //  '{y}-{m}-{d} {h}:{i}'
1554
           if (device.disinfection === 0) {
1568
           if (device.disinfection === 0) {
1555
             this.userform.disinfection = "";
1569
             this.userform.disinfection = "";
1556
           }
1570
           }
1571
+          this.userform.user_total = totals.toString() 
1557
         }
1572
         }
1558
       });
1573
       });
1559
     },
1574
     },
1978
     getUserForm(id) {
1993
     getUserForm(id) {
1979
       getUserForm(id, this.limit, this.page).then(response => {
1994
       getUserForm(id, this.limit, this.page).then(response => {
1980
         if (response.data.state === 1) {
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
           var addmacher = response.data.data.addmacher;
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
           for (let index = 0; index < information.length; index++) {
2000
           for (let index = 0; index < information.length; index++) {
1989
             if (information[index].class === 1) {
2001
             if (information[index].class === 1) {
1990
               information[index].class = "上午";
2002
               information[index].class = "上午";
2086
               information[index].disinfectant_type = "500mg/l含氯消毒剂";
2098
               information[index].disinfectant_type = "500mg/l含氯消毒剂";
2087
             }
2099
             }
2088
             if (information[index].disinfectant_type === 3) {
2100
             if (information[index].disinfectant_type === 3) {
2089
-              information[idnex].disinfectant_type = "1000mg/l含氯消毒剂";
2101
+              information[index].disinfectant_type = "1000mg/l含氯消毒剂";
2090
             }
2102
             }
2091
             if (information[index].disinfectant_type === 4) {
2103
             if (information[index].disinfectant_type === 4) {
2092
               information[index].disinfectant_type = "1500mg/l含氯消毒剂";
2104
               information[index].disinfectant_type = "1500mg/l含氯消毒剂";
2217
             if (information[index].clean === 2) {
2229
             if (information[index].clean === 2) {
2218
               information[index].clean = "";
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
           var total = response.data.data.total;
2233
           var total = response.data.data.total;
2225
           console.log("total", total);
2234
           console.log("total", total);
2232
       getBedForm(id).then(response => {
2241
       getBedForm(id).then(response => {
2233
         if (response.data.state === 1) {
2242
         if (response.data.state === 1) {
2234
           var addmacher = response.data.data.addmacher;
2243
           var addmacher = response.data.data.addmacher;
2235
-          console.log("addmacher=============", addmacher);
2236
           var number = response.data.data.number;
2244
           var number = response.data.data.number;
2237
           console.log("number", number);
2245
           console.log("number", number);
2238
           //改动
2246
           //改动
2258
       PostSearch(key).then(response => {
2266
       PostSearch(key).then(response => {
2259
         if (response.data.state == 1) {
2267
         if (response.data.state == 1) {
2260
           searchArray = response.data.data.patient;
2268
           searchArray = response.data.data.patient;
2261
-          // console.log("ser=================",searchArray)
2262
-
2263
           cb(searchArray);
2269
           cb(searchArray);
2264
         }
2270
         }
2265
       });
2271
       });
2350
   },
2356
   },
2351
   watch: {
2357
   watch: {
2352
     userdata(newvalue, oldvalue) {
2358
     userdata(newvalue, oldvalue) {
2353
-      console.log("newvalue是什么", newvalue);
2354
       this.getUserForm(newvalue);
2359
       this.getUserForm(newvalue);
2355
       this.getBedForm(newvalue);
2360
       this.getBedForm(newvalue);
2356
       this.value = newvalue;
2361
       this.value = newvalue;

+ 39 - 94
src/xt_pages/management/home.vue View File

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

+ 27 - 3
src/xt_pages/management/index.vue View File

126
         </el-table-column>
126
         </el-table-column>
127
 
127
 
128
         <el-table-column label="使用次数" align="center">
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
         </el-table-column>
130
         </el-table-column>
131
 
131
 
132
         <el-table-column label="操作" width="120" align="center">
132
         <el-table-column label="操作" width="120" align="center">
162
 
162
 
163
 <script>
163
 <script>
164
 import BreadCrumb from "../components/bread-crumb";
164
 import BreadCrumb from "../components/bread-crumb";
165
-import { getAllMachineInfo, getAllSubregion } from "@/api/manage";
165
+import { getAllMachineInfo, getAllSubregion,getUserMachTotalCount } from "@/api/manage";
166
 import ManageForm from "./components/ManageForm";
166
 import ManageForm from "./components/ManageForm";
167
 
167
 
168
 export default {
168
 export default {
205
         equipmentid: "",
205
         equipmentid: "",
206
         statusid: ""
206
         statusid: ""
207
       },
207
       },
208
-      total: 0
208
+      total: 0,
209
+      count:[],
209
     };
210
     };
210
   },
211
   },
211
   methods: {
212
   methods: {
313
           id
314
           id
314
       });
315
       });
315
       // this.$router.push({ path: '/device/home?index=' + index + '&' + 'id=' + id })
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
   created() {
341
   created() {
319
     // 获取所有的分区
342
     // 获取所有的分区
320
     this.getAllSubregion();
343
     this.getAllSubregion();
321
     this.getAllMachineInfo();
344
     this.getAllMachineInfo();
345
+    this.getUserMachTotalCount()
322
   }
346
   }
323
 };
347
 };
324
 </script>
348
 </script>