Procházet zdrojové kódy

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

杨青 před 1 rokem
rodič
revize
29ef641dd6
2 změnil soubory, kde provedl 704 přidání a 0 odebrání
  1. 19 0
      src/router/modules/logIndex.js
  2. 685 0
      src/xt_pages/log/index.vue

+ 19 - 0
src/router/modules/logIndex.js Zobrazit soubor

@@ -0,0 +1,19 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+ 
5
+  path: '/log_index',
6
+  component: Layout,
7
+  name:'log_index',
8
+  redirct: '/dialysis/dialysisLogIndex',
9
+  children: [{
10
+    path: '/dialysis/dialysisLogIndex',
11
+    component: () => import('@/xt_pages/log/index'),
12
+    name: '日志查询',
13
+    meta: {
14
+      title: '日志查询',
15
+      noCache: true
16
+    }
17
+  },]
18
+ 
19
+}

+ 685 - 0
src/xt_pages/log/index.vue Zobrazit soubor

@@ -0,0 +1,685 @@
1
+<template>
2
+  <div class="main-contain">
3
+   <div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+  </div>
6
+  <div class="app-container">
7
+      <el-tabs v-model="activeName" @tab-click="handleClick">
8
+          <el-tab-pane label="透析处方" name="first">
9
+            <div style="width: 465px;white-space: nowrap;">
10
+              <span>日期查询:</span>
11
+           
12
+              <el-date-picker
13
+                v-model="record_date"
14
+                prefix-icon="el-icon-date"
15
+                @change="changeTime"
16
+                style="width:150px;"
17
+                type="date"
18
+                placeholder="选择日期时间"
19
+                align="right"
20
+                value-format="yyyy-MM-dd"
21
+              ></el-date-picker>
22
+
23
+             
24
+              <el-autocomplete
25
+                style="margin:16px 5px"
26
+                popper-class="my-autocomplete"
27
+                v-model.trim="patient_name"
28
+                :fetch-suggestions="querySearchAsync"
29
+                :trigger-on-focus="false"
30
+                placeholder="请输入患者姓名"
31
+                @select="handleSelect"
32
+              >
33
+                <i
34
+                  class="el-icon-search el-input__icon"
35
+                  slot="suffix"
36
+                >
37
+                </i>
38
+                <template slot-scope="{ item }">
39
+                  <div class="name">{{ item.name }}</div>
40
+                </template>
41
+             </el-autocomplete>
42
+
43
+            </div>
44
+           
45
+            <el-table
46
+                :data="prescriptionlogList"
47
+                border
48
+                style="width: 100%">
49
+                <el-table-column  prop="date" label="序号" min-width="50"  align="center">
50
+                   <template slot-scope="scope" >
51
+                       {{scope.$index + 1 }}
52
+                   </template>
53
+                </el-table-column>
54
+
55
+                <el-table-column  prop="date" label="患者姓名" min-width="50"  align="center">
56
+                   <template slot-scope="scope" >
57
+                       {{ getPatientName(scope.row.patient_id) }}
58
+                   </template>
59
+                </el-table-column>
60
+
61
+                <el-table-column  prop="date" label="操作人" min-width="50"  align="center">
62
+                   <template slot-scope="scope" >
63
+                       {{getUserName(scope.row.admin_user_id)}}
64
+                   </template>
65
+                </el-table-column>
66
+
67
+
68
+                <el-table-column  prop="date" label="操作时间" min-width="50"  align="center">
69
+                   <template slot-scope="scope" >
70
+                       {{getTime(scope.row.ctime) }}
71
+                   </template>
72
+                </el-table-column>
73
+                
74
+               
75
+                
76
+              </el-table>
77
+              <el-pagination
78
+                @size-change="handleSizeChange"
79
+                @current-change="handleCurrentChange"
80
+                :page-size="10"
81
+                background
82
+                style="margin-top:20px;float: right"
83
+                :total="total"
84
+            ></el-pagination>
85
+          </el-tab-pane>
86
+
87
+          <el-tab-pane label="透前评估" name="second">
88
+            
89
+            <div style="width: 465px;white-space: nowrap;">
90
+              <span>日期查询:</span>
91
+           
92
+              <el-date-picker
93
+                v-model="record_date"
94
+                prefix-icon="el-icon-date"
95
+                @change="changeTime"
96
+                style="width:150px;"
97
+                type="date"
98
+                placeholder="选择日期时间"
99
+                align="right"
100
+                value-format="yyyy-MM-dd"
101
+              ></el-date-picker>
102
+
103
+             
104
+              <el-autocomplete
105
+                style="margin:16px 5px"
106
+                popper-class="my-autocomplete"
107
+                v-model.trim="patient_name"
108
+                :fetch-suggestions="querySearchAsync"
109
+                :trigger-on-focus="false"
110
+                placeholder="请输入患者姓名"
111
+                @select="handleSelect"
112
+              >
113
+                <i
114
+                  class="el-icon-search el-input__icon"
115
+                  slot="suffix"
116
+                >
117
+                </i>
118
+                <template slot-scope="{ item }">
119
+                  <div class="name">{{ item.name }}</div>
120
+                </template>
121
+             </el-autocomplete>
122
+
123
+            </div>
124
+           
125
+            <el-table
126
+                :data="beforLogList"
127
+                border
128
+                style="width: 100%">
129
+                <el-table-column  prop="date" label="序号" min-width="50"  align="center">
130
+                   <template slot-scope="scope" >
131
+                       {{scope.$index + 1 }}
132
+                   </template>
133
+                </el-table-column>
134
+
135
+                <el-table-column  prop="date" label="患者姓名" min-width="50"  align="center">
136
+                   <template slot-scope="scope" >
137
+                       {{ getPatientName(scope.row.patient_id) }}
138
+                   </template>
139
+                </el-table-column>
140
+
141
+                <el-table-column  prop="date" label="操作人" min-width="50"  align="center">
142
+                   <template slot-scope="scope" >
143
+                       {{getUserName(scope.row.admin_user_id)}}
144
+                   </template>
145
+                </el-table-column>
146
+
147
+
148
+                <el-table-column  prop="date" label="操作时间" min-width="50"  align="center">
149
+                   <template slot-scope="scope" >
150
+                       {{getTime(scope.row.ctime) }}
151
+                   </template>
152
+                </el-table-column>
153
+                
154
+               
155
+                
156
+              </el-table>
157
+              <el-pagination
158
+                @size-change="handleSizeChangeOne"
159
+                @current-change="handleCurrentChangeOne"
160
+                :page-size="10"
161
+                background
162
+                style="margin-top:20px;float: right"
163
+                :total="total"
164
+            ></el-pagination>
165
+
166
+          </el-tab-pane>
167
+
168
+          <el-tab-pane label="临时医嘱" name="third">
169
+            <div style="width: 465px;white-space: nowrap;">
170
+              <span>日期查询:</span>
171
+           
172
+              <el-date-picker
173
+                v-model="record_date"
174
+                prefix-icon="el-icon-date"
175
+                @change="changeTime"
176
+                style="width:150px;"
177
+                type="date"
178
+                placeholder="选择日期时间"
179
+                align="right"
180
+                value-format="yyyy-MM-dd"
181
+              ></el-date-picker>
182
+
183
+             
184
+              <el-autocomplete
185
+                style="margin:16px 5px"
186
+                popper-class="my-autocomplete"
187
+                v-model.trim="patient_name"
188
+                :fetch-suggestions="querySearchAsync"
189
+                :trigger-on-focus="false"
190
+                placeholder="请输入患者姓名"
191
+                @select="handleSelect"
192
+              >
193
+                <i
194
+                  class="el-icon-search el-input__icon"
195
+                  slot="suffix"
196
+                >
197
+                </i>
198
+                <template slot-scope="{ item }">
199
+                  <div class="name">{{ item.name }}</div>
200
+                </template>
201
+             </el-autocomplete>
202
+
203
+            </div>
204
+           
205
+            <el-table
206
+                :data="adviceLogList"
207
+                border
208
+                style="width: 100%">
209
+                <el-table-column  prop="date" label="序号" min-width="50"  align="center">
210
+                   <template slot-scope="scope" >
211
+                       {{scope.$index + 1 }}
212
+                   </template>
213
+                </el-table-column>
214
+
215
+                <el-table-column  prop="date" label="患者姓名" min-width="50"  align="center">
216
+                   <template slot-scope="scope" >
217
+                       {{ getPatientName(scope.row.patient_id) }}
218
+                   </template>
219
+                </el-table-column>
220
+
221
+                <el-table-column prop="date" label="操作步骤" min-width="50"  align="center">
222
+                  <template slot-scope="scope" >
223
+                      <span v-if="scope.row.module == 1">新增或修改</span>
224
+                      <span v-if="scope.row.module == 2">执行</span>
225
+                      <span v-if="scope.row.module == 3">核对</span>
226
+                      <span v-if="scope.row.module == 4">删除</span>
227
+                   </template>
228
+                </el-table-column>
229
+
230
+                <el-table-column  prop="date" label="操作人" min-width="50"  align="center">
231
+                   <template slot-scope="scope" >
232
+                       {{getUserName(scope.row.admin_user_id)}}
233
+                   </template>
234
+                </el-table-column>
235
+
236
+
237
+                <el-table-column  prop="date" label="操作时间" min-width="50"  align="center">
238
+                   <template slot-scope="scope" >
239
+                       {{getTime(scope.row.ctime) }}
240
+                   </template>
241
+                </el-table-column>
242
+
243
+              </el-table>
244
+              <el-pagination
245
+                @size-change="handleSizeChangeTwo"
246
+                @current-change="handleCurrentChangeTwo"
247
+                :page-size="10"
248
+                background
249
+                style="margin-top:20px;float: right"
250
+                :total="total"
251
+            ></el-pagination>
252
+          </el-tab-pane>
253
+
254
+          <el-tab-pane label="透析监测" name="four">
255
+             
256
+            <div style="width: 465px;white-space: nowrap;">
257
+              <span>日期查询:</span>
258
+           
259
+              <el-date-picker
260
+                v-model="record_date"
261
+                prefix-icon="el-icon-date"
262
+                @change="changeTime"
263
+                style="width:150px;"
264
+                type="date"
265
+                placeholder="选择日期时间"
266
+                align="right"
267
+                value-format="yyyy-MM-dd"
268
+              ></el-date-picker>
269
+
270
+             
271
+              <el-autocomplete
272
+                style="margin:16px 5px"
273
+                popper-class="my-autocomplete"
274
+                v-model.trim="patient_name"
275
+                :fetch-suggestions="querySearchAsync"
276
+                :trigger-on-focus="false"
277
+                placeholder="请输入患者姓名"
278
+                @select="handleSelect"
279
+              >
280
+                <i
281
+                  class="el-icon-search el-input__icon"
282
+                  slot="suffix"
283
+                >
284
+                </i>
285
+                <template slot-scope="{ item }">
286
+                  <div class="name">{{ item.name }}</div>
287
+                </template>
288
+             </el-autocomplete>
289
+
290
+            </div>
291
+           
292
+            <el-table
293
+                :data="monitorLogList"
294
+                border
295
+                style="width: 100%">
296
+                <el-table-column  prop="date" label="序号" min-width="50"  align="center">
297
+                   <template slot-scope="scope" >
298
+                       {{scope.$index + 1 }}
299
+                   </template>
300
+                </el-table-column>
301
+
302
+                <el-table-column  prop="date" label="患者姓名" min-width="50"  align="center">
303
+                   <template slot-scope="scope" >
304
+                       {{ getPatientName(scope.row.patient_id) }}
305
+                   </template>
306
+                </el-table-column>
307
+
308
+                <el-table-column prop="date" label="操作步骤" min-width="50"  align="center">
309
+                  <template slot-scope="scope" >
310
+                      <span v-if="scope.row.module == 1">新增</span>
311
+                      <span v-if="scope.row.module == 3">修改</span>
312
+                      <span v-if="scope.row.module == 4">删除</span>
313
+                     
314
+                   </template>
315
+                </el-table-column>
316
+
317
+                <el-table-column  prop="date" label="操作人" min-width="50"  align="center">
318
+                   <template slot-scope="scope" >
319
+                       {{getUserName(scope.row.admin_user_id)}}
320
+                   </template>
321
+                </el-table-column>
322
+
323
+
324
+                <el-table-column  prop="date" label="操作时间" min-width="50"  align="center">
325
+                   <template slot-scope="scope" >
326
+                       {{getTime(scope.row.ctime) }}
327
+                   </template>
328
+                </el-table-column>
329
+
330
+              </el-table>
331
+              <el-pagination
332
+                @size-change="handleSizeChangeThree"
333
+                @current-change="handleCurrentChangeThree"
334
+                :page-size="10"
335
+                background
336
+                style="margin-top:20px;float: right"
337
+                :total="total"
338
+            ></el-pagination>
339
+          </el-tab-pane>
340
+
341
+          <el-tab-pane label="透后评估" name="five">
342
+            <div style="width: 465px;white-space: nowrap;">
343
+              <span>日期查询:</span>
344
+           
345
+              <el-date-picker
346
+                v-model="record_date"
347
+                prefix-icon="el-icon-date"
348
+                @change="changeTime"
349
+                style="width:150px;"
350
+                type="date"
351
+                placeholder="选择日期时间"
352
+                align="right"
353
+                value-format="yyyy-MM-dd"
354
+              ></el-date-picker>
355
+
356
+             
357
+              <el-autocomplete
358
+                style="margin:16px 5px"
359
+                popper-class="my-autocomplete"
360
+                v-model.trim="patient_name"
361
+                :fetch-suggestions="querySearchAsync"
362
+                :trigger-on-focus="false"
363
+                placeholder="请输入患者姓名"
364
+                @select="handleSelect"
365
+              >
366
+                <i
367
+                  class="el-icon-search el-input__icon"
368
+                  slot="suffix"
369
+                >
370
+                </i>
371
+                <template slot-scope="{ item }">
372
+                  <div class="name">{{ item.name }}</div>
373
+                </template>
374
+             </el-autocomplete>
375
+
376
+            </div>
377
+           
378
+            <el-table
379
+                :data="afterLogList"
380
+                border
381
+                style="width: 100%">
382
+                <el-table-column  prop="date" label="序号" min-width="50"  align="center">
383
+                   <template slot-scope="scope" >
384
+                       {{scope.$index + 1 }}
385
+                   </template>
386
+                </el-table-column>
387
+
388
+                <el-table-column  prop="date" label="患者姓名" min-width="50"  align="center">
389
+                   <template slot-scope="scope" >
390
+                       {{ getPatientName(scope.row.patient_id) }}
391
+                   </template>
392
+                </el-table-column>
393
+
394
+                <el-table-column  prop="date" label="操作人" min-width="50"  align="center">
395
+                   <template slot-scope="scope" >
396
+                       {{getUserName(scope.row.admin_user_id)}}
397
+                   </template>
398
+                </el-table-column>
399
+
400
+
401
+                <el-table-column  prop="date" label="操作时间" min-width="50"  align="center">
402
+                   <template slot-scope="scope" >
403
+                       {{getTime(scope.row.ctime) }}
404
+                   </template>
405
+                </el-table-column>
406
+                
407
+               
408
+                
409
+              </el-table>
410
+              <el-pagination
411
+                @size-change="handleSizeChangeFour"
412
+                @current-change="handleCurrentChangeFour"
413
+                :page-size="10"
414
+                background
415
+                style="margin-top:20px;float: right"
416
+                :total="total"
417
+            ></el-pagination>
418
+          </el-tab-pane>
419
+        
420
+      </el-tabs>
421
+   </div>
422
+
423
+   
424
+  </div>
425
+</template>
426
+<script>
427
+  import {getPatientList,getPrescriptionLogList,getBeforLogList,getDocLogLogList,getMonitorLogList,getAferLogList} from  "@/api/dialysis"
428
+  import { uParseTime } from '@/utils/tools'
429
+  const moment = require('moment')
430
+  export default {
431
+    data(){
432
+      return {
433
+        activeName: 'first',
434
+        prescriptionList:[],
435
+        record_date:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
436
+        patientList:[],
437
+        patient_id:0,
438
+        patient_name:"",
439
+        total:0,
440
+        page:1,
441
+        limit:10,
442
+        crumbs: [
443
+         { path: false, name: "日志查询" },      
444
+        ],
445
+        prescriptionlogList:[],
446
+        patients:[],
447
+        roleList:[],
448
+        beforLogList:[],
449
+        docLogList:[],
450
+        adviceLogList:[],
451
+        monitorLogList:[],
452
+        afterLogList:[],
453
+      }
454
+    },
455
+    methods:{
456
+      handleClick(val){
457
+        console.log("val2o2o2o2",this.activeName)
458
+        if(this.activeName == "first"){
459
+          this.getPrescriptionLogList()
460
+        }
461
+        if(this.activeName == "second"){
462
+          this.getBeforLogList()
463
+        }
464
+        if(this.activeName == "third"){
465
+          this.getDocLogLogList()
466
+        }
467
+        if(this.activeName == "four"){
468
+          this.getMonitorLogList()
469
+        }
470
+        if(this.activeName == "five"){
471
+          this.getAferLogList()
472
+        }
473
+      },
474
+      querySearchAsync(keyword, cb) {
475
+        let key = '';
476
+        if (keyword != undefined) {
477
+          key = keyword
478
+        }
479
+        let searchArray = []
480
+        getPatientList(key).then(response => {
481
+          if (response.data.state == 1) {
482
+            searchArray = response.data.data.patientList
483
+            console.log('searcharrya', searchArray)
484
+            cb(searchArray)
485
+          }
486
+        })
487
+        return searchArray
488
+      },
489
+      handleSelect(val) {
490
+       this.patient_id = val.id
491
+       this.patient_name = val.name
492
+       this.getPrescriptionLogList()
493
+       this.getBeforLogList()
494
+       this.getDocLogLogList()
495
+       this.getMonitorLogList()
496
+       this.getAferLogList()
497
+      },
498
+      handleCurrentChange(val){
499
+        this.page = val
500
+        this.getPrescriptionLogList()
501
+      },
502
+      handleSizeChange(val){
503
+        this.limit=val
504
+        this.getPrescriptionLogList()
505
+      },
506
+      handleCurrentChangeOne(val){
507
+         this.page = val
508
+         this.getBeforLogList()
509
+      },
510
+      handleSizeChangeOne(val){
511
+        this.limit =val
512
+        this.getBeforLogList()
513
+      },
514
+      handleCurrentChangeTwo(val){
515
+         this.page = val
516
+         this.getDocLogLogList()
517
+      },
518
+      handleSizeChangeTwo(val){
519
+        this.limit =val
520
+        this.getDocLogLogList()
521
+      },
522
+      handleSizeChangeThree(val){
523
+        this.limit =val
524
+        this.getMonitorLogList()
525
+      },
526
+      handleCurrentChangeThree(val){
527
+        this.page = val
528
+        this.getMonitorLogList()
529
+      },
530
+      handleSizeChangeFour(val){
531
+        this.limit =val
532
+        this.getAferLogList()
533
+      },
534
+      handleCurrentChangeFour(val){
535
+        this.page = val
536
+        this.getAferLogList()
537
+      },
538
+      changeTime(val){
539
+        console.log("va222o3o22o3",val)
540
+        this.record_date = val
541
+        console.log("wowowoow",this.activeName)
542
+        if(this.activeName == "first"){
543
+          this.getPrescriptionLogList()
544
+        }
545
+        if(this.activeName == "second"){
546
+          this.getBeforLogList()
547
+        }
548
+        if(this.activeName == "third"){
549
+          this.getDocLogLogList()
550
+        }
551
+        if(this.activeName == "four"){
552
+          this.getMonitorLogList()
553
+        }
554
+        if(this.activeName == "five"){
555
+          this.getAferLogList()
556
+        }
557
+
558
+      },
559
+
560
+      getPrescriptionLogList(){
561
+           var params = {
562
+             record_date:this.record_date,
563
+             patient_id: this.patient_id,
564
+             limit:this.limit,
565
+             page:this.page,
566
+           }
567
+           console.log("paramswoowow",params)
568
+        getPrescriptionLogList(params).then(response=>{
569
+           if(response.data.state== 1){
570
+              this.prescriptionlogList =  response.data.data.prescriptionlogList
571
+              this.total= response.data.data.total
572
+
573
+              this.patients = response.data.data.patients
574
+
575
+              this.roleList = response.data.data.role
576
+           }
577
+        })
578
+      },
579
+      getPatientName(patient_id){
580
+         var name = ""
581
+        for(let i=0;i<this.patients.length;i++){
582
+          if(patient_id == this.patients[i].id){
583
+             name = this.patients[i].name
584
+          }
585
+        }
586
+        return name
587
+      },
588
+      getUserName(admin_user_id){
589
+        var user_name = ""
590
+        for(let i=0;i<this.roleList.length;i++){
591
+          if(admin_user_id == this.roleList[i].admin_user_id){
592
+             user_name = this.roleList[i].user_name
593
+          }   
594
+        }
595
+        return user_name
596
+      },
597
+
598
+      getTime(val) {
599
+         if(val < 0){
600
+           return ""
601
+         }
602
+         if(val == ""){
603
+          return ""
604
+         }else {
605
+          return uParseTime(val, '{y}-{m}-{d} {h}:{i}:{s}')
606
+         }
607
+      },
608
+     
609
+      getBeforLogList(){
610
+        var params = {
611
+             record_date:this.record_date,
612
+             patient_id: this.patient_id,
613
+             limit:this.limit,
614
+             page:this.page,
615
+           }
616
+         
617
+       getBeforLogList(params).then(response=>{
618
+         if(response.data.state == 1){
619
+          this.beforLogList =  response.data.data.beforLogList
620
+          this.total= response.data.data.total
621
+          this.patients = response.data.data.patients
622
+          this.roleList = response.data.data.role
623
+         }
624
+       }) 
625
+      },
626
+      getDocLogLogList(){
627
+        var params = {
628
+             record_date:this.record_date,
629
+             patient_id: this.patient_id,
630
+             limit:this.limit,
631
+             page:this.page,
632
+           }
633
+        getDocLogLogList(params).then(response=>{
634
+           if(response.data.state == 1){
635
+             this.adviceLogList =  response.data.data.adviceLogList
636
+             this.total= response.data.data.total
637
+            this.patients = response.data.data.patients
638
+            this.roleList = response.data.data.role
639
+           }
640
+        })
641
+      },
642
+      getMonitorLogList(){
643
+        var params = {
644
+             record_date:this.record_date,
645
+             patient_id: this.patient_id,
646
+             limit:this.limit,
647
+             page:this.page,
648
+           }
649
+        getMonitorLogList(params).then(response=>{
650
+          if(response.data.state== 1){
651
+            this.monitorLogList =  response.data.data.monitorLogList
652
+             this.total= response.data.data.total
653
+            this.patients = response.data.data.patients
654
+            this.roleList = response.data.data.role
655
+          }
656
+        })
657
+      },
658
+
659
+      getAferLogList(){
660
+         var params = {
661
+             record_date:this.record_date,
662
+             patient_id: this.patient_id,
663
+             limit:this.limit,
664
+             page:this.page,
665
+           }
666
+        getAferLogList(params).then(response=>{
667
+           if(response.data.state == 1){
668
+            this.afterLogList =  response.data.data.afterLogList
669
+             this.total= response.data.data.total
670
+            this.patients = response.data.data.patients
671
+            this.roleList = response.data.data.role
672
+           }
673
+        })
674
+      }
675
+      
676
+    },
677
+    created(){
678
+
679
+      this.record_date = moment(new Date()).add('year',0).format("YYYY-MM-DD")
680
+      this.getPrescriptionLogList()
681
+      
682
+      
683
+    },
684
+  }
685
+</script>