Przeglądaj źródła

Merge branch 'superman' of http://git.shengws.com/zhangbj/xt_vue into superman

柳香萍 6 lat temu
rodzic
commit
3df4a5d7c4

+ 9 - 0
src/api/qcd.js Wyświetl plik

@@ -100,3 +100,12 @@ export function GetPersonICData(params) {
100 100
   })
101 101
 }
102 102
 
103
+
104
+export function GetPersonAdviceData(params) {
105
+  return request({
106
+    url: '/api/qcd/papersonadvicedata',
107
+    method: 'get',
108
+    params: params
109
+  })
110
+}
111
+

+ 1 - 0
src/xt_pages/qcd/patientAnalysis/person/components/personNav.vue Wyświetl plik

@@ -4,6 +4,7 @@
4 4
         <el-tab-pane label="体重" name="weight"></el-tab-pane>
5 5
         <el-tab-pane label="血压" name="bloodpressure"></el-tab-pane>
6 6
         <el-tab-pane label="指标控制" name="indicators"></el-tab-pane>
7
+        <el-tab-pane label="口服药" name="oralmedicine"></el-tab-pane>
7 8
     </el-tabs>
8 9
 </template>
9 10
 <script>

+ 532 - 0
src/xt_pages/qcd/patientAnalysis/person/oralMedicine.vue Wyświetl plik

@@ -0,0 +1,532 @@
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" id="outcome-indicators-query">
7
+      <person-info :patient="patientInfo"></person-info>
8
+      <person-nav activeName="oralmedicine" :patientID="patientID"></person-nav>
9
+
10
+      
11
+      <div class="cell clearfix">
12
+        <label class="title">
13
+          <span class="name">日期查询</span> :
14
+        </label>
15
+        <el-date-picker
16
+          v-model="listQuery.start_time"
17
+          prefix-icon="el-icon-date"
18
+          @change="changeTime"
19
+          :editable="false"
20
+          style="width: 196px;"
21
+          type="date"
22
+          placeholder="选择日期时间"
23
+          align="right"
24
+          format="yyyy-MM-dd"
25
+          value-format="yyyy-MM-dd"
26
+        ></el-date-picker>
27
+        <span class>-</span>
28
+        <el-date-picker
29
+          v-model="listQuery.end_time"
30
+          prefix-icon="el-icon-date"
31
+          @change="changeTime"
32
+          :editable="false"
33
+          style="width: 196px;"
34
+          type="date"
35
+          placeholder="选择日期时间"
36
+          align="right"
37
+          format="yyyy-MM-dd"
38
+          value-format="yyyy-MM-dd"
39
+        ></el-date-picker>
40
+      </div>
41
+      
42
+      <div class="cell clearfix">
43
+        <label class="title">
44
+          <span class="name">医嘱类型</span> :
45
+        </label>
46
+        <div class="time">
47
+          <ul class>
48
+            <li
49
+              :class="item.value==adviceType?'active':''"
50
+              @click="selectAdviceType( item.value)"
51
+              v-for="item in adviceTypeOptions"
52
+              :key="item.value"
53
+            >{{item.label}}</li>
54
+          </ul>
55
+        </div>
56
+      </div>
57
+      <div class="cell clearfix">
58
+        <label class="title">
59
+          <span class="name">药品类型</span> :
60
+        </label>
61
+        <el-select v-model="listQuery.advice_type" filterable clearable placeholder="请选择">
62
+          <el-option
63
+            v-for="item in medicalOptions"
64
+            :key="item.id"
65
+            :label="item.name"
66
+            :value="item.id">
67
+          </el-option>
68
+        </el-select>
69
+      </div>
70
+      
71
+      <div class="cqd-dataTitle">统计图</div>
72
+      <el-row :gutter="32">
73
+        <el-col :xs="24" :sm="24" :lg="24">
74
+          <div class="chart-wrapper">
75
+              <line-chart title="曲线图(Kg)" :options="CompletionOptions" />
76
+          </div>
77
+        </el-col>
78
+      </el-row>
79
+
80
+      <div style="height:20px">&nbsp;</div>
81
+      <div class="cqd-dataTitle">统计表</div>
82
+      <el-table
83
+        ref="multipleTable"
84
+        :data="tableData"
85
+        border
86
+        fit
87
+        highlight-current-row
88
+        :cell-style="cellstyle"
89
+        style="width: 100%;margin-top: 10px;"
90
+        id="qcd-person-oral-medical"
91
+        :span-method="mergeSpan" 
92
+        :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
93
+      >
94
+        <el-table-column  label="医嘱类型" width="80" property="advice_type" align="center" >
95
+            <template slot-scope="scope">
96
+                <span v-if="scope.row.advice_type==1">长期</span>
97
+                <span v-else-if="scope.row.advice_type==2">临时</span>
98
+                <span v-else></span>
99
+            </template>
100
+        </el-table-column>
101
+        
102
+        <el-table-column  label="医嘱内容" property="advice_name" min-width="180" align="center" >
103
+            <template slot-scope="scope">
104
+               {{scope.row.parent_id>0?'&nbsp;&nbsp;':''}} {{scope.row.advice_name }}
105
+            </template>
106
+        </el-table-column>
107
+        
108
+        <el-table-column  label="GROUP" width="180" property="groupno" align="center">
109
+        </el-table-column>
110
+        <el-table-column  label="开始时间" width="180" property="start_time" align="center">
111
+        </el-table-column>
112
+        <el-table-column label="停止时间" width="180"  property="stop_time" align="center">
113
+            <template slot-scope="scope">
114
+                <span v-if="scope.row.stop_state==1"> {{scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
115
+            </template>
116
+        </el-table-column>
117
+        
118
+        <el-table-column label="开嘱医生" width="180"  property="advice_doctor" align="center">
119
+            <template slot-scope="scope">
120
+                {{getXuserName(scope.row.advice_doctor)}}
121
+            </template>
122
+        </el-table-column>
123
+        
124
+        <el-table-column  label="执行护士" width="180"  property="execution_staff" align="center">
125
+            <template slot-scope="scope">
126
+                <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
127
+            </template>
128
+        </el-table-column>
129
+        
130
+      </el-table>
131
+
132
+      <!-- <pagi-nation title="分页"></pagi-nation> -->
133
+
134
+      <el-pagination
135
+      align="right"
136
+        @size-change="handleSizeChange"
137
+        @current-change="handleCurrentChange"
138
+        :current-page="listQuery.pate"
139
+        :page-sizes="[10, 20, 50, 100]"
140
+        :page-size="10"
141
+        background
142
+        style="margin-top:20px;"
143
+        layout="total, sizes, prev, pager, next, jumper"
144
+        :total="total"
145
+      ></el-pagination>
146
+    </div>
147
+  </div>
148
+</template>
149
+
150
+
151
+<script>
152
+import { GetPersonAdviceData  } from "@/api/qcd";
153
+import {jsGetAge, uParseTime} from "@/utils/tools";
154
+import personNav from './components/personNav'
155
+import personInfo from './components/personInfo'
156
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
157
+import LineChart from "../../components/LineChart";
158
+export default {
159
+  name: "totalAnalysis",
160
+  data() {
161
+    return {
162
+      crumbs:[
163
+        {path:false, name:'科室质控'},
164
+        {path:false, name:'患者分析'},
165
+        {path:false, name:'统计'},
166
+        {path:false, name:'口服药'},
167
+      ],
168
+      total: 0,
169
+      patientMap:{},
170
+      listQuery: {
171
+        start_time: "",
172
+        end_time: "",
173
+        page: 1,
174
+        limit: 10,
175
+      },
176
+      CompletionOptions:{
177
+          xAxis:[],
178
+          legend:[],
179
+          series:[],
180
+      },
181
+      medicalOptions:[],
182
+      tableData: [],
183
+      pieData:[],
184
+      patientInfo:null,
185
+      patientID:0,
186
+      adviceType:0,
187
+      adviceTypeOptions: [
188
+        { value: 0, label: "全部",  },
189
+        { value: 2, label: "临时医嘱", },
190
+        { value: 1, label: "长期医嘱",  },
191
+      ],
192
+      adminUserOptions: {},
193
+      tableRow: [],
194
+    };
195
+  },
196
+  created() {
197
+    var patientID = this.$route.query && this.$route.query.id;
198
+    if(typeof(patientID) == 'undefined' || !patientID || patientID<=0) {
199
+      this.$message.error('参数错误,无法请求');
200
+      return false;
201
+    }
202
+    patientID = parseInt(patientID);
203
+    this.patientID = patientID;
204
+    this.listQuery.patient_id = patientID;
205
+
206
+    var nowDate = new Date();
207
+    var nowYear = nowDate.getFullYear();
208
+    var nowMonth = nowDate.getMonth() + 1;
209
+    var nowDay = nowDate.getDate();
210
+    this.listQuery.end_time =
211
+      nowYear +
212
+      "-" +
213
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
214
+      "-" +
215
+      (nowDay < 10 ? "0" + nowDay : nowDay);
216
+    nowDate.setMonth(nowDate.getMonth() - 3);
217
+    nowYear = nowDate.getFullYear();
218
+    nowMonth = nowDate.getMonth() + 1;
219
+    nowDay = nowDate.getDate();
220
+    this.listQuery.start_time =
221
+      nowYear +
222
+      "-" +
223
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
224
+      "-" +
225
+      (nowDay < 10 ? "0" + nowDay : nowDay);
226
+    
227
+    this.getList();
228
+  },
229
+  methods: {
230
+    getList() {
231
+      GetPersonAdviceData(this.listQuery).then(response => {
232
+        if (response.data.state == 0) {
233
+          this.$message.error(response.data.msg);
234
+          return false;
235
+        } else {
236
+            this.tableData = [];
237
+            this.total = response.data.data.total;
238
+            this.patientInfo = response.data.data.patient;
239
+            var advices = response.data.data.advices;
240
+            for (const index in advices) {
241
+                this.tableData.push(advices[index]);
242
+            }
243
+            var adminUserOptions = response.data.data.users;
244
+            for (const index in adminUserOptions) {
245
+              this.adminUserOptions[adminUserOptions[index].id] = adminUserOptions[index];
246
+            }
247
+            // var pieData = response.data.data.pie;
248
+            // for (const index in pieData) {
249
+            //     this.pieData.push(pieData[index]);
250
+            // }
251
+        }
252
+      });
253
+    },
254
+    cellstyle(row){
255
+      if (row.columnIndex == 1) {
256
+        return 'text-align:left;';
257
+      }
258
+      return '';
259
+    },
260
+    
261
+    handleTableRow() {
262
+      this.tableRow = [];
263
+      var pos = 0;
264
+      for (const index in this.tableData) {
265
+        if (index==0) {
266
+          this.tableRow.push(1);
267
+          pos = 0;
268
+        }else {
269
+          if (this.tableData[index].groupno === this.tableData[index-1].groupno) {
270
+            this.tableRow[pos] += 1;
271
+            this.tableRow.push(0);
272
+          }else {
273
+            this.tableRow.push(1);
274
+            pos = index;
275
+          }
276
+        }
277
+      }
278
+    },
279
+    mergeSpan({ row, column, rowIndex, columnIndex }) {
280
+      if (columnIndex !== 1 ) {
281
+        const _row = this.tableRow[rowIndex];
282
+        const _col = _row > 0 ? 1 : 0;
283
+        return {
284
+          rowspan: _row,
285
+          colspan: _col
286
+        };
287
+      }
288
+    },
289
+    changeTime() {
290
+      this.getList();
291
+    },
292
+    onSearch(){
293
+      this.getList();
294
+    },
295
+    changeModel() {
296
+      this.getList();
297
+    },
298
+    handleSizeChange(val) {
299
+      this.listQuery.limit = val;
300
+      this.getList();
301
+    },
302
+    handleCurrentChange(val) {
303
+      this.listQuery.page = val;
304
+      this.getList();
305
+    },
306
+    getTime(value, temp) {
307
+        if (value != undefined) {
308
+          return uParseTime(value, temp)
309
+        }
310
+        return ""
311
+    },
312
+    
313
+    getXuserName(id) {
314
+      if (id <= 0) {
315
+        return "";
316
+      }
317
+      if (id in this.adminUserOptions) {
318
+        return this.adminUserOptions[id].name;
319
+      }
320
+      return ''
321
+    },
322
+    getProjectName(id) {
323
+      return (id in this.projectOptions) ? this.projectOptions[id].project_name:'';
324
+    },
325
+    getPatientName(id) {
326
+      return (id in this.patientMap) ? this.patientMap[id].name:'';
327
+    },
328
+    getPatientLapseto(lapseto) {
329
+      if(lapseto==1) {
330
+        return '留治';
331
+      }else if(lapseto == 2) {
332
+        return '转出';
333
+      }
334
+      return '--';
335
+    },
336
+    getPatientSource(srouce){
337
+      if(srouce==1) {
338
+        return '门诊';
339
+      }else if(srouce == 2) {
340
+        return '住院';
341
+      }
342
+      return '其他';
343
+    },
344
+    getPatientGender(gender) {
345
+      if (gender == 1) {
346
+        return '男';
347
+      } else if(gender == 2) {
348
+        return '女';
349
+      }
350
+      return '';
351
+    },
352
+    tranAge(birthday) {
353
+        var birth = uParseTime(birthday, '{y}-{m}-{d}');
354
+        return jsGetAge(birth, '-');
355
+    },
356
+    getPatientDialysisNo(id) {
357
+      return (id in this.patientMap) ? this.patientMap[id].dialysis_no:'';
358
+    },
359
+    getItemVulue(project_id, item_id, row) {
360
+        var key = project_id + '_' + item_id;
361
+        return (typeof(row.items) !== 'undefined' && (key in row.items)) ? row.items[key].inspect_value:'';
362
+    },
363
+    renderheader(h, { column, $index }) {
364
+        return h('span', {}, [
365
+            h('span', {}, column.label.split('//')[0]),
366
+            h('br'),
367
+            h('span', {}, column.label.split('//')[1])
368
+        ])
369
+    },
370
+    selectAdviceType(type) {
371
+      this.adviceType = type;
372
+      this.listQuery.advice_type = type;
373
+      this.getList();
374
+    },
375
+    drawPie(){
376
+      this.CompletionOptions = {
377
+          xAxis:[],
378
+          legend:[],
379
+          series:[],
380
+      };
381
+
382
+
383
+      if(this.diagramType !== 1 && this.diagramType !== 2) {
384
+        return false;
385
+      }
386
+
387
+      if (this.diagramType == 1) {
388
+        this.CompletionOptions.legend = ['透前体重', '透后体重', '干体重'];
389
+        this.CompletionOptions.series = [
390
+          { name:'透前体重', type:'line', data:[] },
391
+          { name:'透后体重', type:'line', data:[] },
392
+          { name:'干体重', type:'line', data:[] },
393
+        ];
394
+      }else {
395
+        this.CompletionOptions.legend = ['体重增加'];
396
+        this.CompletionOptions.series = [
397
+          // { name:'透前体重', type:'line', data:[] },
398
+          { name:'体重增加', type:'line', data:[] },
399
+          // { name:'干体重', type:'line', data:[] },
400
+        ];
401
+      }
402
+      for (const index in this.pieData) {
403
+
404
+        var dateDay = uParseTime(this.pieData[index].schedule_date, '{y}-{m}-{d}');
405
+        if (this.diagramType == 1) {
406
+          this.CompletionOptions.xAxis.push(dateDay);
407
+          if (this.pieData[index].assessment_after_dislysis) {
408
+            this.CompletionOptions.series[1].data.push(this.pieData[index].assessment_after_dislysis.weight_after);
409
+          } else {
410
+            this.CompletionOptions.series[1].data.push(0);
411
+          }
412
+          if (this.pieData[index].assessment_before_dislysis) {
413
+            this.CompletionOptions.series[0].data.push(this.pieData[index].assessment_before_dislysis.weight_before);
414
+            this.CompletionOptions.series[2].data.push(this.pieData[index].assessment_before_dislysis.dry_weight);
415
+          } else {
416
+            this.CompletionOptions.series[0].data.push(0);
417
+            this.CompletionOptions.series[2].data.push(0);
418
+          }
419
+        } else {
420
+          this.CompletionOptions.xAxis.push(dateDay);
421
+          if (this.pieData[index].assessment_before_dislysis) {
422
+            var weightTem = this.pieData[index].assessment_before_dislysis.weight_before - this.pieData[index].assessment_before_dislysis.dry_weight;
423
+            // this.CompletionOptions.series[0].data.push(this.pieData[index].assessment_before_dislysis.weight_before);
424
+            this.CompletionOptions.series[0].data.push(weightTem);
425
+            // this.CompletionOptions.series[2].data.push(this.pieData[index].assessment_before_dislysis.dry_weight);
426
+          } else {
427
+            this.CompletionOptions.series[0].data.push(0);
428
+          }
429
+        }
430
+      }
431
+    },
432
+  },
433
+  components: {
434
+      personNav,
435
+      BreadCrumb,
436
+      personInfo,
437
+      LineChart
438
+  },
439
+  watch:{
440
+    "diagramType":function(){
441
+      this.drawPie();
442
+    },
443
+    "pieData":function (){
444
+      this.drawPie();
445
+    },
446
+    'tableData':function (){
447
+      this.handleTableRow();
448
+    }
449
+  }
450
+};
451
+</script>
452
+<style>
453
+#oictable ::-webkit-scrollbar {
454
+  height: 15px;
455
+}
456
+#outcome-indicators-query .el-form-item {
457
+    margin-bottom: 0px !important;
458
+}
459
+</style>
460
+
461
+
462
+<style rel="stylesheet/scss" lang="scss" scoped>
463
+.app-container {
464
+//   margin: 20px;
465
+  font-size: 15px;
466
+  .filter-container {
467
+    padding-bottom: 5px;
468
+  }
469
+  .cqd-dataTitle{
470
+    color: #303133;
471
+    font-size: 14px;
472
+    border-bottom: 2px #E4E7ED solid;
473
+    height: 36px;
474
+    line-height: 36px;
475
+    margin: 0 0 25px 0;
476
+    position: relative;
477
+  }
478
+  .cqd-dataTitle::before {
479
+      position: absolute;
480
+      left: 0;
481
+      bottom: -2px;
482
+      content: "";
483
+      width: 42px;
484
+      height: 2px;
485
+      background: #409eff;
486
+  }
487
+  .search-component {
488
+    width: 500px;
489
+    .searchBox {
490
+      width: 300px;
491
+      height: 36px;
492
+      line-height: 36px;
493
+      padding-left: 15px;
494
+      border: 1px #dcdfe6 solid;
495
+      border-right: none;
496
+      outline: none;
497
+      float: left;
498
+      border-radius: 6px 0 0 6px;
499
+      font-size: 14px;
500
+      color: #333;
501
+      background: #fff;
502
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
503
+    }
504
+    .searchBtn {
505
+      background-color: #409eff;
506
+      color: #fff;
507
+      font-size: 15px;
508
+      text-align: center;
509
+      height: 36px;
510
+      line-height: 36px;
511
+      float: left;
512
+      outline: none;
513
+      width: 70px;
514
+      border: none;
515
+      border-radius: 0 6px 6px 0;
516
+      font-family: "Microsoft Yahei";
517
+      cursor: pointer;
518
+    }
519
+  }
520
+  .amount {
521
+    font-weight: normal;
522
+    padding: 10px 0 0 0;
523
+    color: #606266;
524
+    font-size: 14px;
525
+    span {
526
+      color: #ef2525;
527
+      font-family: "Arial";
528
+      padding: 0 2px;
529
+    }
530
+  }
531
+}
532
+</style>