Browse Source

设备管理代码

xiaoming_global 5 years ago
parent
commit
70fbe8d6bf

+ 33 - 0
src/api/manage.js View File

@@ -234,6 +234,7 @@ export function SaveBacteria(id, data) {
234 234
 }
235 235
 
236 236
 export function SaveLincomycin(id, data) {
237
+  console.log("data", data);
237 238
   return request({
238 239
     url: "/api/manage/savelincomycin?id=" + id,
239 240
     method: "Post",
@@ -492,3 +493,35 @@ export function UpdateMacheineTwo(data) {
492 493
     data: data
493 494
   });
494 495
 }
496
+
497
+export function getBedForm(id, params) {
498
+  return request({
499
+    url: "/api/manage/getbedform?id=" + id,
500
+    method: "get",
501
+    params: params
502
+  });
503
+}
504
+
505
+export function getTotalCount(params) {
506
+  return request({
507
+    url: "/api/manage/gettotalcount",
508
+    method: "Get",
509
+    params: params
510
+  });
511
+}
512
+
513
+export function getTotalNumber(id, params) {
514
+  return request({
515
+    url: "/api/manage/getotalnumber?id=" + id,
516
+    method: "Get",
517
+    params: params
518
+  });
519
+}
520
+
521
+export function getTimeWarning(id, params) {
522
+  return request({
523
+    url: "/api/manage/gettimewarning?id=" + id,
524
+    method: "Get",
525
+    params: params
526
+  });
527
+}

+ 17 - 2
src/xt_pages/management/components/MultipleForm.vue View File

@@ -262,7 +262,7 @@
262 262
               width="100"
263 263
               align="center"
264 264
             >
265
-              <template slot-scope="scope">{{ failure_times }}</template>
265
+              <template slot-scope="scope">{{ failure }}</template>
266 266
             </el-table-column>
267 267
           </el-table>
268 268
         </el-row>
@@ -281,14 +281,19 @@
281 281
 import {
282 282
   getAllSubregion,
283 283
   getAllEquimentName,
284
-  getComprehensive
284
+  getComprehensive,
285
+  getTotalCount
285 286
 } from '@/api/manage'
286 287
 import { uParseTime } from '@/utils/tools'
287 288
 export default {
288 289
   name: 'MultipleForm',
290
+  props: {
291
+    equimentid: Number
292
+  },
289 293
   data() {
290 294
     return {
291 295
       failure_times: 0,
296
+      failure: 0,
292 297
       dialogVisible: false,
293 298
       form: {
294 299
         zone: '',
@@ -413,11 +418,21 @@ export default {
413 418
       } else {
414 419
         return uParseTime(time, '{y}-{m}-{d}')
415 420
       }
421
+    },
422
+    getTotalCount() {
423
+      getTotalCount().then(response => {
424
+        if (response.data.state === 1) {
425
+          var total = response.data.data.total
426
+          // console.log('total ========', total)
427
+          this.failure_times = total
428
+        }
429
+      })
416 430
     }
417 431
   },
418 432
   created() {
419 433
     this.getAllSubregion()
420 434
     this.getAllEquimentName()
435
+    this.getTotalCount()
421 436
   }
422 437
 }
423 438
 </script>

+ 19 - 4
src/xt_pages/management/components/PlanForm.vue View File

@@ -1,6 +1,11 @@
1 1
 <template>
2 2
   <div id="plan-form">
3
-    <el-dialog title="新增计划" :visible.sync="dialogVisible" width="55%" center>
3
+    <el-dialog
4
+      title="新增计划"
5
+      :visible.sync="dialogVisible"
6
+      width="55%"
7
+      center
8
+    >
4 9
       <el-form ref="form" :model="form">
5 10
         <el-row>
6 11
           <el-col :span="10">
@@ -17,7 +22,10 @@
17 22
           </el-col>
18 23
           <el-col :span="10">
19 24
             <el-form-item label="消毒时长:">
20
-              <el-input style="width:135px" v-model="form.disinfec_time"></el-input>
25
+              <el-input
26
+                style="width:135px"
27
+                v-model="form.disinfec_time"
28
+              ></el-input>
21 29
               <span>分钟</span>
22 30
             </el-form-item>
23 31
           </el-col>
@@ -79,7 +87,10 @@
79 87
           </el-col>
80 88
           <el-col :span="10">
81 89
             <el-form-item label="机表消毒液:">
82
-              <el-select style="width:135px" v-model="form.machine_disinfectant">
90
+              <el-select
91
+                style="width:135px"
92
+                v-model="form.machine_disinfectant"
93
+              >
83 94
                 <el-option
84 95
                   v-for="item in this.disinfectantType"
85 96
                   :key="item.id"
@@ -238,12 +249,15 @@ export default {
238 249
       var disinfectant = parseInt(disinfectants);
239 250
       this.form.disinfectant = disinfectant;
240 251
       savePlan(this.form, this.equimentid).then(response => {
241
-        if (response.data.state == 1) {
252
+        if (response.data.state === 1) {
242 253
           var msg = response.data.data.msg;
254
+          console.log("msg", msg);
243 255
           this.$message.success("保存成功");
244 256
           this.dialogVisible = false;
245 257
           this.$emit("getAllPlan");
246 258
           this.$emit("getAllPlanDetail");
259
+        } else {
260
+          this.$message.error("该消毒计划已存在");
247 261
         }
248 262
       });
249 263
     },
@@ -251,6 +265,7 @@ export default {
251 265
       getAllEquitType().then(response => {
252 266
         if (response.data.state === 1) {
253 267
           var addmacher = response.data.data.addmacher;
268
+          console.log("addmahcer去重", addmacher);
254 269
           this.DeviceType = addmacher;
255 270
         }
256 271
       });

+ 21 - 8
src/xt_pages/management/components/UserForm.vue View File

@@ -21,7 +21,7 @@
21 21
         <span class="machineClass">机位号:</span>
22 22
         <el-select style="width:80px" v-model="form.bed">
23 23
           <el-option
24
-            v-for="item in this.bedNumber"
24
+            v-for="item in this.bedNumberTwo"
25 25
             :key="item.id"
26 26
             :label="item.number"
27 27
             :value="item.id"
@@ -728,7 +728,8 @@ import {
728 728
   DeleteUserform,
729 729
   UpdateForm,
730 730
   queryInfo,
731
-  getUserForm
731
+  getUserForm,
732
+  getBedForm
732 733
 } from '@/api/manage'
733 734
 import { uParseTime } from '@/utils/tools'
734 735
 import { PostSearch } from '@/api/patient'
@@ -901,7 +902,8 @@ export default {
901 902
       },
902 903
       hiddenShow: false,
903 904
       searchArray: [],
904
-      bed: ''
905
+      bed: '',
906
+      bedNumberTwo: []
905 907
     }
906 908
   },
907 909
   methods: {
@@ -918,7 +920,6 @@ export default {
918 920
       getAllSubregion().then(response => {
919 921
         if (response.data.state === 1) {
920 922
           var zones = response.data.data.zones
921
-          console.log('zonses=====================', zones)
922 923
           var zone = [{ id: 0, name: '全部' }]
923 924
           for (let i = 0; i < zones.length; i++) {
924 925
             const item = zones[i]
@@ -931,7 +932,7 @@ export default {
931 932
             const item = numbers[index]
932 933
             number.push({ id: item.id, number: item.number })
933 934
           }
934
-          this.bedNumber = number
935
+          // this.bedNumber = number
935 936
         }
936 937
       })
937 938
     },
@@ -1806,15 +1807,25 @@ export default {
1806 1807
               information[index].clean = ''
1807 1808
             }
1808 1809
 
1809
-            this.form.zone = information[index].zone
1810
-            this.form.bed = information[index].bed_number
1810
+            // this.form.zone = information[index].zone
1811
+            // this.form.bed = information[index].bed_number
1811 1812
           }
1812 1813
           var total = response.data.data.total
1813
-          console.log('total', total)
1814 1814
           this.tableData = information
1815 1815
           this.total = total
1816 1816
         }
1817 1817
       })
1818
+    },
1819
+    getBedForm(id) {
1820
+      getBedForm(id).then(response => {
1821
+        if (response.data.state === 1) {
1822
+          var addmacher = response.data.data.addmacher
1823
+          var number = response.data.data.number
1824
+          this.form.zone = addmacher.zone_id
1825
+          this.form.bed = addmacher.bed_number
1826
+          this.bedNumberTwo = number
1827
+        }
1828
+      })
1818 1829
     }
1819 1830
   },
1820 1831
   created() {
@@ -1824,7 +1835,9 @@ export default {
1824 1835
   },
1825 1836
   watch: {
1826 1837
     userdata(newvalue, oldvalue) {
1838
+      console.log('new', newvalue)
1827 1839
       this.getUserForm(newvalue)
1840
+      this.getBedForm(newvalue)
1828 1841
     }
1829 1842
   }
1830 1843
 }

+ 104 - 16
src/xt_pages/management/home.vue View File

@@ -937,7 +937,8 @@
937 937
                                              >
938 938
                                            </i>
939 939
                                             <template slot-scope="{ item }">
940
-                                             <span class="addr">{{ item.name }}</span>
940
+                                             <span class="addr">{{ item.name }}</span> 
941
+                                             <span class="addr">{{ item.id }}</span>
941 942
                                            </template>
942 943
                                             </el-autocomplete> -->
943 944
                                        </el-form-item>
@@ -1011,7 +1012,7 @@
1011 1012
                                   </el-col>
1012 1013
                                   <el-col :span="8">
1013 1014
                                       <el-form-item label="使用次数:">
1014
-                                         <el-input style="width:180px" v-model="userform.user_total"></el-input>
1015
+                                         <el-input style="width:180px" v-model="userform.user_total" :disabled="true"></el-input>
1015 1016
                                       </el-form-item>
1016 1017
                                   </el-col>
1017 1018
                                   <el-col :span="8">
@@ -1217,7 +1218,7 @@
1217 1218
                                          <el-radio-group v-model="userform.dialysis_concentration">
1218 1219
                                                 <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in potency" :key="index">{{gender.name}}</el-radio>
1219 1220
                                          </el-radio-group>
1220
-                                        <!-- <span style="color:red">您已一个月未更换,请注意检测</span> -->
1221
+                                        <span class="warn" v-show="warnShow">您已一个月未更换,请注意检测</span>
1221 1222
                                       </el-form-item>
1222 1223
                                    </el-col>
1223 1224
                                 </el-row>
@@ -1225,8 +1226,9 @@
1225 1226
                                    <el-col :span="3">
1226 1227
                                       <el-form-item label="细菌过滤器:"></el-form-item>
1227 1228
                                    </el-col>
1228
-                                    <el-col :span="2">
1229
+                                    <el-col :span="7">
1229 1230
                                       <el-checkbox v-model="userform.germ_checked">更换</el-checkbox>
1231
+                                       <span class="warn" v-show="warnShowTwo">您已一个月未更换,请注意检测</span>
1230 1232
                                    </el-col>
1231 1233
                                    <el-col :span="8">
1232 1234
                                      <el-form-item label="名称:">
@@ -1253,7 +1255,7 @@
1253 1255
                                   </el-col>
1254 1256
                                    <el-col :span="10">
1255 1257
                                       <el-checkbox v-model="userform.clean">清洁:</el-checkbox>
1256
-                                      <!-- <span style="color:red">您已一个月未清洁,请检查</span> -->
1258
+                                      <span class="warn" v-show="warnShowThree">您已一个月未清洁,请检查</span>
1257 1259
                                    </el-col>
1258 1260
                                    <el-col :span="10">
1259 1261
                                        <el-form-item label="签名:" required prop="sign_name">
@@ -1559,17 +1561,18 @@
1559 1561
                               </el-row>
1560 1562
                               <el-row>
1561 1563
                                 <el-col :span="8">
1562
-                                   <el-form-item label="实际Na+(mmol/L):">
1564
+                                  <!-- <span>Na<sup>+</sup></span> -->
1565
+                                   <el-form-item label="实际Na﹢(mmol/L):">
1563 1566
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_na"></el-input>
1564 1567
                                     </el-form-item>
1565 1568
                                 </el-col>
1566 1569
                                  <el-col :span="8">
1567
-                                    <el-form-item label="配方Na+(mmol/L):">
1570
+                                    <el-form-item label="配方Na(mmol/L):">
1568 1571
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_pna"></el-input>
1569 1572
                                     </el-form-item>
1570 1573
                                 </el-col>
1571 1574
                                  <el-col :span="8">
1572
-                                    <el-form-item label="K+ (mmol/L):">
1575
+                                    <el-form-item label="K(mmol/L):">
1573 1576
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_k"></el-input>
1574 1577
                                     </el-form-item>
1575 1578
                                 </el-col>
@@ -1577,24 +1580,24 @@
1577 1580
                               </el-row>
1578 1581
                                <el-row>
1579 1582
                                 <el-col :span="8">
1580
-                                    <el-form-item label="Ca2+(mmol/L):">
1583
+                                    <el-form-item label="Ca2(mmol/L):">
1581 1584
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_ca"></el-input>
1582 1585
                                     </el-form-item>
1583 1586
                                 </el-col>
1584 1587
                                  <el-col :span="8">
1585
-                                    <el-form-item label="CI-(mmol/L):">
1588
+                                    <el-form-item label="CI¯(mmol/L):">
1586 1589
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_ci"></el-input>
1587 1590
                                     </el-form-item>
1588 1591
                                 </el-col>
1589 1592
                                  <el-col :span="8">
1590
-                                    <el-form-item label="HCO3-(mmol/L):">
1593
+                                    <el-form-item label="HCO3¯(mmol/L):">
1591 1594
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_hco"></el-input>
1592 1595
                                     </el-form-item>
1593 1596
                                 </el-col>  
1594 1597
                               </el-row>
1595 1598
                               <el-row>
1596 1599
                                  <el-col :span="8">
1597
-                                    <el-form-item label="Mg2+(mmol/L):">
1600
+                                    <el-form-item label="Mg2(mmol/L):">
1598 1601
                                         <el-input style="width:100px" v-model="qualityFormThree.actual_mg"></el-input>
1599 1602
                                     </el-form-item>
1600 1603
                                 </el-col>
@@ -1836,6 +1839,24 @@
1836 1839
                    </el-tab-pane>
1837 1840
                    </el-tabs>
1838 1841
                 </div>
1842
+
1843
+                <!-- <el-autocomplete
1844
+                  popper-class="my-autocomplete"
1845
+                  v-model="state"
1846
+                 :fetch-suggestions="querySearch"
1847
+                  placeholder="请输入内容"
1848
+                  @select="handleSelect">
1849
+                  <i
1850
+                   class="el-icon-edit el-input__icon"
1851
+                   slot="suffix"
1852
+                  @click="handleIconClick">
1853
+                  </i>
1854
+                 <template slot-scope="{ item }">
1855
+                 <div class="name">{{ item.value }}</div>
1856
+                  <span class="addr">{{ item.address }}</span>
1857
+                  </template>
1858
+                 </el-autocomplete> -->
1859
+
1839 1860
              </el-main>
1840 1861
           </el-container>
1841 1862
         </el-container>
@@ -1845,7 +1866,7 @@
1845 1866
         <plan-form ref="planForm" :equimentid="equimentid" v-on:getAllPlan="getAllPlan" v-on:getAllPlanDetail="getAllPlanDetail"></plan-form>
1846 1867
         <!-- <edit-machine-form ref="editmachineform"  :planid="planid" ></edit-machine-form> -->
1847 1868
         <!-- 综合查询 -->
1848
-        <multiple-form ref="multipleform"></multiple-form>
1869
+        <multiple-form ref="multipleform" :equimentid="equimentid"></multiple-form>
1849 1870
     <!-- 编辑消毒计划 -->
1850 1871
      <el-dialog title="编辑消毒计划" :visible.sync="dialogVisible" width="50%" center>
1851 1872
        <el-form :model="machineform" ref="machineform">
@@ -1975,7 +1996,7 @@
1975 1996
   import { getAllSubregion, getAllMachine, getMachineDetailById,
1976 1997
     UpdateMachineInfo, getAllPlan, getAllPlanDetail, DeletePlans,
1977 1998
     getAllEquimentName, EditPlanDetail, UpdatePlanInfo, SaveInformation, getPatientInfo,
1978
-    ChangeClass, getAllOrganization, getUserRegister, SaveQualityControl, getOrgName, SaveRepair, SaveBacteria, SaveLincomycin,getAutoData,getAllEquitType,UpdateMacheineTwo } from '@/api/manage'
1999
+    ChangeClass, getAllOrganization, getUserRegister, SaveQualityControl, getOrgName, SaveRepair, SaveBacteria, SaveLincomycin,getAutoData,getAllEquitType,UpdateMacheineTwo,getTotalNumber,getTimeWarning } from '@/api/manage'
1979 2000
   import { uParseTime } from '@/utils/tools'
1980 2001
   import { getToken } from '@/api/qiniu'
1981 2002
   import PlanForm from './components/PlanForm'
@@ -2427,6 +2448,9 @@ export default {
2427 2448
         disableFour:true,
2428 2449
         disableFive:true,
2429 2450
         runDisable:true,
2451
+        warnShow:false,
2452
+        warnShowTwo:false,
2453
+        warnShowThree:false,
2430 2454
       }
2431 2455
     },
2432 2456
     methods: {
@@ -2525,6 +2549,8 @@ export default {
2525 2549
         this.getUserRegister(val.id)
2526 2550
         //病人下机后插入数据
2527 2551
         this.getAutoData(val.id)
2552
+        this.getTotalNumber(val.id)
2553
+        this.getTimeWarning(val.id)
2528 2554
       },
2529 2555
       getAutoData(id){
2530 2556
          getAutoData(id).then(response=>{
@@ -3341,6 +3367,9 @@ export default {
3341 3367
      getTimes(time) {
3342 3368
         return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
3343 3369
       },
3370
+      getTime(time) {
3371
+        return uParseTime(time, '{y}-{m}-{d}')
3372
+      },
3344 3373
 
3345 3374
       SaveInformation(formName) {
3346 3375
       
@@ -3711,6 +3740,20 @@ export default {
3711 3740
       },
3712 3741
       SaveLincomycin(formName) {
3713 3742
         this.$refs[formName].validate((valid) => {
3743
+            if(this.qualityFormTwo.specimenb === ""){
3744
+                this.qualityFormTwo.specimenb = 0
3745
+            }
3746
+
3747
+            var specimen =  this.qualityFormTwo.specimenb
3748
+             var specimenb =  parseInt(specimen)
3749
+             this.qualityFormTwo.specimenb = specimenb
3750
+
3751
+            if(this.qualityFormTwo.sampling_locationb === ""){
3752
+                this.qualityFormTwo.sampling_locationb = 0
3753
+            }
3754
+            var sampling =  this.qualityFormTwo.sampling_locationb
3755
+            var samplings =   parseInt(sampling)
3756
+            this.qualityFormTwo.sampling_locationb = samplings
3714 3757
           if (valid) {
3715 3758
             SaveLincomycin(this.equimentid, this.qualityFormTwo).then(response => {
3716 3759
               if (response.data.state === 1) {
@@ -3911,10 +3954,13 @@ export default {
3911 3954
         PostSearch(key).then(response => {
3912 3955
           if (response.data.state == 1) {
3913 3956
             searchArray = response.data.data.patient
3914
-            console.log("ser=================",searchArray)
3957
+            // console.log("ser=================",searchArray)
3958
+            
3915 3959
             cb(searchArray)
3916 3960
           }
3917 3961
         })
3962
+
3963
+        return searchArray
3918 3964
       },
3919 3965
       createFilter(queryString) {
3920 3966
         return (searchArray) => {
@@ -3932,7 +3978,42 @@ export default {
3932 3978
           this.DeviceType = addmacher;
3933 3979
         }
3934 3980
       });
3935
-    }
3981
+     },
3982
+     getTotalNumber(){
3983
+       getTotalNumber(this.equimentid).then(response=>{
3984
+          if(response.data.state === 1){
3985
+            var total =  response.data.data.total
3986
+            if(total === ""){
3987
+              this.userform.user_total = ""
3988
+            }
3989
+            this.userform.user_total = total
3990
+          }else{
3991
+            this.$message.error("数据返回失败")
3992
+          }
3993
+       })
3994
+     },
3995
+     getTimeWarning(id){
3996
+       getTimeWarning(id).then(response=>{
3997
+          if(response.data.state === 1){
3998
+             var information =  response.data.data.information
3999
+             var time = this.userform.date - information.date               
4000
+             if(time >= 2678400){
4001
+               this.warnShow = true
4002
+             }
4003
+             var deviceInformation = response.data.data.deviceInformation
4004
+             console.log("细菌过滤器更换日期",information.date)
4005
+             var timetwo = this.userform.date - deviceInformation.date
4006
+             if(timetwo >= 2678400){
4007
+               this.warnShowTwo = true
4008
+             }
4009
+             var clean =  response.data.data.clean
4010
+             var timethree = this.userform.date - clean.date
4011
+             if(timethree >= 2678400){
4012
+                this.warnShowThree  =  true
4013
+             }            
4014
+          }
4015
+       })
4016
+     },
3936 4017
     },
3937 4018
     created() {
3938 4019
       this.getAllSubregion()
@@ -3947,6 +4028,9 @@ export default {
3947 4028
       this.getOrgName()
3948 4029
       this.getAllEquitType()
3949 4030
     },
4031
+    mounted(){
4032
+      this.searchArray = this.querySearchAsync()
4033
+    }
3950 4034
   }
3951 4035
 </script>
3952 4036
 <style lang="scss" scoped>
@@ -3992,6 +4076,10 @@ export default {
3992 4076
     margin-left: 450px;
3993 4077
     margin-top: 200px;
3994 4078
   }
4079
+  .warn{
4080
+    color: red;
4081
+    font-size: 14px; 
4082
+  }
3995 4083
    
3996 4084
 </style>
3997 4085
 <style lang="scss">

+ 2 - 2
src/xt_pages/sign/index.vue View File

@@ -65,7 +65,7 @@
65 65
                     <div class="border"></div>
66 66
                     <div style="margin-bottom:20px;color:rgb(96,96,96);font-size:14px">
67 67
                     透前体重(kg):&nbsp;<el-input v-model="weigh_list.weight_before" :disabled="disa" style="width:200px"></el-input> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
68
-                    干体重(kg):&nbsp;<el-input v-model="weigh_list.dry_weight" :disabled="disa" style="width:200px"></el-input><br>
68
+                    干体重(kg):&nbsp;<el-input v-model="weigh_list.dry_weight" :disabled="true" style="width:200px"></el-input><br>
69 69
                     </div>
70 70
                     <div style="margin-bottom:12px;color:rgb(96,96,96);font-size:14px">
71 71
                      体温(℃):&nbsp;<el-input v-model="weigh_list.temperature" :disabled="disa" style="width:70px"></el-input>&nbsp;&nbsp;&nbsp;
@@ -76,7 +76,7 @@
76 76
                     <div class="border"></div>
77 77
                     <div style="margin-bottom:20px;color:rgb(96,96,96);font-size:14px">
78 78
                      透后称重(kg):&nbsp;<el-input v-model="weigh_infor.weight_after" style="width:200px" :disabled="disa"></el-input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
79
-                     干体重(kg):&nbsp;<el-input v-model="weigh_list.dry_weight" :disabled="disa" style="width:200px"></el-input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
79
+                     干体重(kg):&nbsp;<el-input v-model="weigh_list.dry_weight" :disabled="true" style="width:200px"></el-input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
80 80
                     </div>
81 81
                     <div style="margin-bottom:12px;color:rgb(96,96,96);font-size:14px">
82 82
                       体温(℃):&nbsp;<el-input v-model="weigh_infor.temperature" :disabled="disa" style="width:70px"></el-input>&nbsp;&nbsp;&nbsp;